public override TASK_RETURN_STATUS Run(Survivor_AI sAI) { sAI.SetMvmtTree(MOVEMENT_TREE.DEFAULT); sAI.GetHiveRef().MoveSurvivorBack(sAI); //sAI.GetSurvivor().MoveTo(sAI.GetCurrDefensePoint().transform.position); return(TASK_RETURN_STATUS.SUCCEED); }
/* FOR SHOWING OFF ASTAR IN GAME IF TIME *****************************************/ void SearchForLoot() { if (SearchingForLoot == false) // && GameManager.GetCurrentWaveNumber() < 4) { List <Loot> lootlist = GameManager.GetLootList(); if (lootlist.Count > 0) { this.UpdateSurvivorList(); foreach (Loot loot in lootlist) { //if(loot.GetLootType() != LOOT_TYPE.GRENADES || loot.GetLootType() != LOOT_TYPE.NULL) //{ Survivor_AI moving = GetClosestSurvivor(loot.transform.position); PathNode[] nodes = GetClosestPathNode(moving.transform.position, loot.transform.position); if (moving != null) { if (moving.mvmtTracker != Moving.MOVING_ON_ASTAR) { moving.start = nodes[0]; moving.end = nodes[1]; moving.GetBlackboard().startNode = nodes[0]; moving.GetBlackboard().goalNode = nodes[1]; moving.SetMvmtTree(MOVEMENT_TREE.ASTAR); SearchingForLoot = true; moving.mvmtTracker = Moving.MOVING_ON_ASTAR; break; } } //} } } else { Invoke("SearchForLoot", 15.0f); } } }