示例#1
0
 protected override void OnEnable()
 {
     base.OnEnable();
     anchor         = tran.position;
     TeamColorMat   = GetComponentInChildren <MeshRenderer>().material;
     eaten          = 0;
     bMoving        = false;
     bReturning     = false;
     spark          = GetComponentInChildren <ParticleSystem>();
     enemies        = new List <Unit_Base>();
     enemiesCarried = new GameObject[maxCarry];
     mask           = 1 << LayerMask.NameToLayer("Units");
     canAttack      = false;
     StartCoroutine(AttackCooldown());
     bDay = NewGameController.Instance.IsDaylight;
     UnityEventManager.StartListeningBool("DayTime", DaySwitch);
 }
示例#2
0
 void OnEnable()
 {
     UnityEventManager.StartListeningBool("DayTime", DaySwitch);
 }