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

        enteredWorldAgent = null;
        dockWorldAgent    = null;

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

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

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