Esempio n. 1
0
 public void OnThisObjectEntrancePosition(WorldAgent agent)
 {
     if (agent.MyCountry == MyCountry)
     {
         Debug.Log("City Entered!");
     }
 }
Esempio n. 2
0
 void Awake()
 {
     actionQueue  = new List <Action>();
     navMeshAgent = GetComponent <NavMeshAgent>();
     inventory    = GetComponent <Inventory>();
     worldAgent   = GetComponent <WorldAgent>();
     workTimer    = 0f;
 }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
    public void Close()
    {
        gameObject.SetActive(false);
        AudioManager.instance.ClickButton();
        UIManager.instance.OnUIPanelClose();

        enteredWorldAgent = null;
        dockWorldAgent    = null;

        isOpened = false;
    }
Esempio n. 5
0
    public bool SpawnWorldAgentInThisCity()
    {
        if (worldAgentDock == null)
        {
            WorldAgent worldAgent = MyCountry.SpawnWorldAgent(entrance.position, MyCountry.isPlayerCountry);
            OnThisObjectReached(worldAgent);
            return(true);
        }

        return(false);
    }
Esempio n. 6
0
    public override void OnThisObjectReached(WorldAgent enteredAgent)
    {
        if (MyCountry == enteredAgent.MyCountry)
        {
            UIManager.instance.ExchangePanel.Open(enteredAgent, this);
        }
        else
        {
            EnterThisObject(enteredAgent);
        }

        enteredAgent.MoveToTargetObject(null);
    }
Esempio n. 7
0
 public override void OnThisObjectReached(WorldAgent enteredAgent)
 {
     if (!enteredWorldAgent)
     {
         enteredWorldAgent = enteredAgent;
         if (enteredWorldAgent.GetComponent <EnemyAgent>())
         {
             HandleAIEntrance();
         }
         else
         {
             HandlePlayerEntrance();
         }
     }
 }
Esempio n. 8
0
    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;
    }
Esempio n. 9
0
 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());
        }
Esempio n. 11
0
 public override void OnThisObjectReached(WorldAgent enteredAgent)
 {
     Debug.LogError("PlotCity entered");
     EnterThisObject(enteredAgent);
 }
Esempio n. 12
0
 public void RemoveFromList(WorldAgent agent)
 {
     worldAgents.Remove(agent);
 }
Esempio n. 13
0
 public override void OnBattleWon(TargetableObject attacker)
 {
     attacker.MyCountry.Inventory.AddItem(chosenItemsOption);
     enteredWorldAgent = null;
     DestroyMe();
 }
Esempio n. 14
0
 public override void OnBattleLost(TargetableObject attacker)
 {
     enteredWorldAgent = null;
     Destroy(attacker.gameObject);
 }
Esempio n. 15
0
 public override void OnThisObjectReached(WorldAgent agent)
 {
     EnterThisObject(agent);
     OnThisObjectEntrancePosition(agent);
 }
Esempio n. 16
0
 public void Close()
 {
     snapTarget = null;
     gameObject.SetActive(false);
 }
Esempio n. 17
0
 public override void OnThisObjectReached(WorldAgent agent)
 {
     EnterThisObject(agent);
 }
Esempio n. 18
0
 public void ChaseWorldAgent(WorldAgent agentToChase)
 {
     blackboard.targetableObject = agentToChase;
     stateMachine.ChangeState(new ChaseState());
 }