public void OnThisObjectEntrancePosition(WorldAgent agent) { if (agent.MyCountry == MyCountry) { Debug.Log("City Entered!"); } }
void Awake() { actionQueue = new List <Action>(); navMeshAgent = GetComponent <NavMeshAgent>(); inventory = GetComponent <Inventory>(); worldAgent = GetComponent <WorldAgent>(); workTimer = 0f; }
public WorldAgent SpawnEnemyAgent(Vector3 pos, Quaternion quaternion, Country country) { WorldAgent agent = Instantiate(enemyAgentPrefab, pos, quaternion); SceneParent.ParentGameObjectToMe(agent.transform); agent.Setup(country); worldAgents.Add(agent); return(agent); }
public void Close() { gameObject.SetActive(false); AudioManager.instance.ClickButton(); UIManager.instance.OnUIPanelClose(); enteredWorldAgent = null; dockWorldAgent = null; isOpened = false; }
public bool SpawnWorldAgentInThisCity() { if (worldAgentDock == null) { WorldAgent worldAgent = MyCountry.SpawnWorldAgent(entrance.position, MyCountry.isPlayerCountry); OnThisObjectReached(worldAgent); return(true); } return(false); }
public override void OnThisObjectReached(WorldAgent enteredAgent) { if (MyCountry == enteredAgent.MyCountry) { UIManager.instance.ExchangePanel.Open(enteredAgent, this); } else { EnterThisObject(enteredAgent); } enteredAgent.MoveToTargetObject(null); }
public override void OnThisObjectReached(WorldAgent enteredAgent) { if (!enteredWorldAgent) { enteredWorldAgent = enteredAgent; if (enteredWorldAgent.GetComponent <EnemyAgent>()) { HandleAIEntrance(); } else { HandlePlayerEntrance(); } } }
public void Open(WorldAgent enteredAgent, WorldAgent dockAgent) { if (enteredAgent == dockAgent) { Debug.Log("Can not open Exchange UI, because both objects are the same"); return; } UIManager.instance.WorldAgentPanel.Close(); enteredWorldAgent = enteredAgent; dockWorldAgent = dockAgent; Refresh(); if (!isOpened) { gameObject.SetActive(true); UIManager.instance.OnUIPanelOpen(); } isOpened = true; }
public void Open(WorldAgent target) { gameObject.SetActive(true); snapTarget = target; transform.localScale = new Vector3(0.01f, 0.01f, 0.01f); }
public void CreateAgent(WorldGrid worldGrid) { WorldAgent myAgent = (Instantiate(Resources.Load("AgentEdge")) as GameObject).GetComponent <WorldAgent>(); myAgent.Initialize(worldGrid, NewId()); }
public override void OnThisObjectReached(WorldAgent enteredAgent) { Debug.LogError("PlotCity entered"); EnterThisObject(enteredAgent); }
public void RemoveFromList(WorldAgent agent) { worldAgents.Remove(agent); }
public override void OnBattleWon(TargetableObject attacker) { attacker.MyCountry.Inventory.AddItem(chosenItemsOption); enteredWorldAgent = null; DestroyMe(); }
public override void OnBattleLost(TargetableObject attacker) { enteredWorldAgent = null; Destroy(attacker.gameObject); }
public override void OnThisObjectReached(WorldAgent agent) { EnterThisObject(agent); OnThisObjectEntrancePosition(agent); }
public void Close() { snapTarget = null; gameObject.SetActive(false); }
public override void OnThisObjectReached(WorldAgent agent) { EnterThisObject(agent); }
public void ChaseWorldAgent(WorldAgent agentToChase) { blackboard.targetableObject = agentToChase; stateMachine.ChangeState(new ChaseState()); }