コード例 #1
0
    public void SelectObject(GameObject selectedObject)
    {
        SolarSystem system = selectedObject.GetComponent <SolarSystem>();

        if (system)
        {
            systemUI.UpdateSystem(system);
            system.SelectSystem(true);
            SelectNewObject(system.gameObject);
            ChooseUI(systemUI.gameObject);
            return;
        }

        //Army army = selectedObject.GetComponent<Army>();
        //if (army)
        //{
        //    armyUI.SetArmies(new List<Army>() { army });
        //    systemUI.gameObject.SetActive(false);
        //}


        Agent agent = selectedObject.GetComponent <Agent>();

        if (agent && agent.GetPlayer().IsHumanPlayer())
        {
            agent.SelectAgent(true);
            agentUI.SelectAgent(agent);
            SelectNewObject(agent.gameObject);
            ChooseUI(agentUI.gameObject);
            return;
        }

        PlayerBase playerBase = selectedObject.GetComponent <PlayerBase>();

        if (playerBase && playerBase.GetPlayer().IsHumanPlayer())
        {
            playerBase.SelectBase(true);
            SelectNewObject(playerBase.gameObject);
            ChooseUI(playerBaseUI.gameObject);
            return;
        }
    }
コード例 #2
0
 public void SelectBuilding(PlayerBuildingConfig playerBuildingConfig)
 {
     currentSystem.GetComponent <PlayerBuildingController>().BuildPlayerBuilding(playerBuildingConfig, currentPlayer, buildingNumber);
     systemUI.UpdateSystem(currentSystem);
     Deactivate();
 }