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

        enteredWorldAgent = null;
        dockWorldAgent    = null;

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

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

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