Ejemplo n.º 1
0
        public override bool OnMessage(UIMessage msg)
        {
            switch (msg.type)
            {
            case UIMsgType.GameAreaStateChange:
                RefreshAreaState();
                return(true);

            case UIMsgType.MainShip_Area_EnergyLoad_Change:
                UpdateEnergyLoad();
                return(true);

            case UIMsgType.MainShip_Area_PowerLevel_Change:
                return(UpdateAreaEnergyCost((MainShipAreaType)msg.content[0]));

            case UIMsgType.MenuPage_Update_BuildPanel:
                FunctionBlockTypeData typeData = (FunctionBlockTypeData)msg.content[0];
                var type = FunctionBlockModule.GetBlockType(typeData);
                return(RefreshBuildMainPanel(type));

            case UIMsgType.UpdateTime:
                return(UpdateTimePanel());

            default:
                return(false);
            }
        }
Ejemplo n.º 2
0
    public override void Construction()
    {
        AllFunctionBlockList = new List <FunctionBlock>();
        for (int i = 0; i < 2; i++)
        {
            FunctionBlock fac = new FunctionBlock();
            fac.FunctionBlockID   = i;
            fac.BlockName         = "";
            fac.BlockBG           = "";
            fac.BlockIcon         = "";
            fac.BlockDesc         = "";
            fac.PreLevelBlock     = i;
            fac.FunctionBlockType = "";
            AllFunctionBlockList.Add(fac);
        }

        AllFunctionBlockTypeDataList = new List <FunctionBlockTypeData>();
        for (int i = 0; i < 2; i++)
        {
            FunctionBlockTypeData type = new FunctionBlockTypeData();
            type.Type        = "";
            type.DefaultShow = true;
            type.TypeName    = "";
            type.TypeDesc    = "";
            type.TypeIcon    = "";
            AllFunctionBlockTypeDataList.Add(type);
        }
    }
Ejemplo n.º 3
0
        public static FunctionBlockType GetBlockType(FunctionBlockTypeData data)
        {
            FunctionBlockType result = FunctionBlockType.None;

            Enum.TryParse <FunctionBlockType>(data.Type, out result);
            return(result);
        }
Ejemplo n.º 4
0
 public void InitMainTabElement(FunctionBlockTypeData data)
 {
     typedata    = data;
     Icon.sprite = FunctionBlockModule.GetMainTypeSprite(data);
     toggle.onValueChanged.AddListener((bool isOn) =>
     {
         OnTabClick(isOn);
     });
 }
Ejemplo n.º 5
0
        //Get Type Data
        public static FunctionBlockTypeData GetFacotryTypeData(FunctionBlockType type)
        {
            FunctionBlockTypeData typeData = null;

            FunctionBlockTypeDataDic.TryGetValue(type.ToString(), out typeData);
            if (typeData != null)
            {
                return(typeData);
            }
            else
            {
                Debug.LogError("GetFunctionBlockType Error Type= " + type);
                return(null);
            }
        }
Ejemplo n.º 6
0
 public static string GetMainTypeName(FunctionBlockTypeData data)
 {
     return(MultiLanguage.Instance.GetTextValue(data.TypeName));
 }
Ejemplo n.º 7
0
 public static Sprite GetMainTypeSprite(FunctionBlockTypeData data)
 {
     return(Utility.LoadSprite(data.TypeIcon));
 }