override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     array     = animator.GetComponentInParent <GameObjectArray>();
     activeBef = array.GetActive(index);
     if (animator.GetCurrentAnimatorStateInfo(layerIndex).fullPathHash == stateInfo.fullPathHash && stateInfo.normalizedTime > startTime && stateInfo.normalizedTime < endTime)
     {
         array.SetActive(index, value);
     }
     isExit = false;
 }
Exemple #2
0
 protected override void OnUpdate()
 {
     if (group.GetEntityArray().Length > 0)
     {
         List <ParentSpawnerData> parentSpawnerDatas = new List <ParentSpawnerData>(10);
         EntityManager.GetAllUniqueSharedComponentData(parentSpawnerDatas);
         int lengthParentSpawner = parentSpawnerDatas.Count;
         for (int ParentSpawnerIndex = 1; ParentSpawnerIndex < lengthParentSpawner; ++ParentSpawnerIndex)
         {
             Entity    parent      = parentSpawnerDatas[ParentSpawnerIndex].Parent;
             float     respawnTime = EntityManager.GetSharedComponentData <BonusSpawnerComponentData>(parent).bonusRespawnDelay;
             TimerData timer       = new TimerData();
             timer.Interval = respawnTime;
             EntityManager.AddComponentData(parent, timer);
         }
         GameObjectArray gameObjects = spawners.GetGameObjectArray();
         int             length      = gameObjects.Length;
         for (int i = 0; i < length; ++i)
         {
             gameObjects[i].GetComponent <SpawnerComponent>().enabled = true;
         }
     }
 }
Exemple #3
0
 public GameGrid(Vector gameSize)
 {
     GameSize          = gameSize;
     GameObjects       = GameObjectArray.New(gameSize);
     CollisionDetector = new CollisionDetector(this);
 }