// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2020-09-02 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using UnityEngine; public static class MonoEx { public static ParticleEmitter particleEmitter(this Transform behaviour) { return new ParticleEmitter(); } } namespace G { /// /// /// public class BulletPet2 : MonoBehaviour { public float delay_collision = 0.2f; public float delay_destroy = 0.6f; private float _delay; private Collider _collider; private bool _impactOn; private void Awake() { _collider = this.GetComponent(); this.gameObject.SetActive(false); } private void OnEnable() { _collider.enabled = false; _delay = 0f; _impactOn = false; Vector3 forward = this.transform.forward; forward.y = 0f; this.transform.rotation = Quaternion.LookRotation(forward); } private void Update() { if (_delay > delay_destroy) { _collider.enabled = false; this.gameObject.SetActive(false); } else if (!_impactOn && _delay > delay_collision) { EntityPet.Instance.AttackFinish(); _collider.enabled = true; _impactOn = true; } _delay += Time.deltaTime; } } }