コード例 #1
0
    void SelectCurrentBuildingToConstruct(IMessage _msg)
    {
        CompoundDescription description = CompoundManager.Instance.m_Compounds[m_SelectedBuildingId];
        BuildingToConstruct msg         = new BuildingToConstruct(description.m_Prefab);

        MessageManager.Instance.Send(msg);

        MessageManager.Instance.Send(MessageId.MSG__UI__HIDE_BUILDING_PANEL);
    }
コード例 #2
0
        void BuildingToConstructSelected(IMessage _msg)
        {
            BuildingToConstruct message = _msg.GetMessage <BuildingToConstruct>();

            //create new instance of object
            Transform gameObjectTransform = (Transform)Instantiate(message.m_Prefab, Vector3.zero, Quaternion.identity);

            m_BuildingInConstruction = gameObjectTransform.gameObject;
            m_CompoundInConstruction = m_BuildingInConstruction.GetComponent <Compound>();

            //switch input mode to construction
            m_InputMode = InputMode.BuildingConstruction;
            MessageManager.Instance.Send(MessageId.MSG__UI__SHOW_BUILDING_CONSTRUCTION_CONTROL);
        }