public void Look(BaseMono self, BaseMono mono) { if (mono != null && self != null && Trans != null) { Trans.LookAt(mono.Trans, Vector3.forward); } }
public void SetPos(BaseMono mono) { if (mono == null) { return; } RTSCamera.transform.position = mono.transform.position - Vector3.forward; JumpTo(mono); }
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)); }
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; }
protected T Cast <T>(BaseMono obj) where T : BaseMono { return(obj as T); }
public void JumpTo(BaseMono mono) { RTSCamera.JumpTo(mono.Trans); }
// 获得组建 public static T GetUnityComponet <T>(BaseMono mono) where T : Component { return(GetUnityComponet <T>(mono.GO)); }
protected override void OnEnable() { base.OnEnable(); preFabOverride = target as BaseMono; }