Пример #1
0
 public void Look(BaseMono self, BaseMono mono)
 {
     if (mono != null && self != null && Trans != null)
     {
         Trans.LookAt(mono.Trans, Vector3.forward);
     }
 }
Пример #2
0
 public void SetPos(BaseMono mono)
 {
     if (mono == null)
     {
         return;
     }
     RTSCamera.transform.position = mono.transform.position - Vector3.forward;
     JumpTo(mono);
 }
Пример #3
0
 public static Direct LeftOrRight(BaseMono self, BaseMono target)
 {
     if (self == null)
     {
         throw new System.Exception("self 为空");
     }
     if (target == null)
     {
         throw new System.Exception("target 为空");
     }
     return(LeftOrRight(self.Trans.forward, target.Pos - self.Pos));
 }
Пример #4
0
 public override void OnBeAdded(IMono mono)
 {
     base.OnBeAdded(mono);
     Timer              = new Timer(UpdateTimer);
     SenseGameObj       = new GameObject("SenseObj");
     SenseGameObj.layer = (int)BaseConstMgr.Layer_Sense;
     SenseGameObj.transform.SetParent(Mono.Trans);
     SenseGameObj.transform.localPosition = Vector3.zero;
     SenseGameObj.transform.localScale    = Vector3.one;
     SenseGameObj.transform.localRotation = Quaternion.identity;
     SenseObject = BaseMono.GetUnityComponet <BaseSenseObj>(SenseGameObj);
     SenseObject.Init(this);
     SphereCollider           = SenseGameObj.AddComponent <SphereCollider>();
     SphereCollider.isTrigger = true;
     SphereCollider.radius    = Radius;
 }
Пример #5
0
 protected T Cast <T>(BaseMono obj) where T : BaseMono
 {
     return(obj as T);
 }
Пример #6
0
 public void JumpTo(BaseMono mono)
 {
     RTSCamera.JumpTo(mono.Trans);
 }
Пример #7
0
 // 获得组建
 public static T GetUnityComponet <T>(BaseMono mono) where T : Component
 {
     return(GetUnityComponet <T>(mono.GO));
 }
Пример #8
0
 protected override void OnEnable()
 {
     base.OnEnable();
     preFabOverride = target as BaseMono;
 }