BulletGoCtrl.cs 434 B

123456789101112131415161718192021222324252627282930
  1. using UnityEngine;
  2. using System.Collections;
  3. public class BulletGoCtrl : MonoBehaviour
  4. {
  5. public Bullet Bullet { get; set; }
  6. void Update ()
  7. {
  8. if (Bullet != null && Bullet.MoveProcessor!=null)
  9. {
  10. Bullet.FrameUpdate(Time.deltaTime);
  11. }
  12. }
  13. void OnDisable ()
  14. {
  15. Bullet = null;
  16. }
  17. void OnEnable()
  18. {
  19. if (Bullet != null)
  20. {
  21. Bullet.ForceSync (transform);
  22. }
  23. }
  24. }