shaoxiadiablo/Assets/AGame/Scripts/Game/Skill/Bullet_arrow_ride.cs

53 lines
1.2 KiB
C#
Raw Normal View History

2025-05-18 01:04:31 +08:00
// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2020-09-02
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "Bullet_arrow_ride" company="Kimch"></copyright>
// <summary></summary>
// ***********************************************************************
using UnityEngine;
namespace G
{
public class Bullet_arrow_ride : MonoBehaviour
{
public float bullet_speed;
private Transform mytransform;
private Transform cha1;
private Cha_Control_ride_cha script_cha;
private void Awake()
{
mytransform = base.transform;
}
private void Start()
{
cha1 = GameObject.FindWithTag("Player").transform;
script_cha = cha1.GetComponent<Cha_Control_ride_cha>();
}
private void OnTriggerEnter(Collider other)
{
if (other.transform.IsChildOf(cha1))
{
base.gameObject.SetActive(false);
mytransform.position = Vector3.one * 12f;
script_cha.Damaged();
}
}
private void Update()
{
mytransform.position += mytransform.forward * Time.deltaTime * bullet_speed;
}
}
}