25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
Bu depo arşivlendi. Dosyaları görüntüleyebilir ve klonlayabilirsiniz ama işlem gönderemez ve konu/değişiklik isteği açamazsınız.

38 satır
1.0KB

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using coa4u;
  5. namespace coa4u
  6. {
  7. /// <summary>
  8. /// Moves the target to the random point inside the given zone.
  9. /// </summary>
  10. class ActionSelectRoamingPoint : ActionInstant
  11. {
  12. protected Vector3 radius;
  13. protected Vector3 pointRef;
  14. protected float speed;
  15. protected Vector3 delta;
  16. public ActionSelectRoamingPoint(Vector3 targetRadius, ref Vector3 point)
  17. : base()
  18. {
  19. radius = targetRadius;
  20. pointRef = point;
  21. }
  22. public override ActionInstant Clone()
  23. {
  24. return new ActionSelectRoamingPoint(radius, ref pointRef);
  25. }
  26. public override void Start()
  27. {
  28. base.Start();
  29. pointRef.x = UnityEngine.Random.Range(-radius.x, radius.x);
  30. pointRef.y = UnityEngine.Random.Range(-radius.y, radius.y);
  31. pointRef.z = UnityEngine.Random.Range(-radius.z, radius.z);
  32. }
  33. }
  34. }