Пример #1
0
    public void SetButtonActive(int btnId)
    {
        activeState = (EnumScript.State)(((int)activeState == btnId) ? ConstantScript.initial : btnId);
        switch (activeState)
        {
        case EnumScript.State.Plant:
            btnPlant.image.color  = activeColor;
            btnMove.image.color   = inactiveColor;
            btnDelete.image.color = inactiveColor;
            break;

        case EnumScript.State.Move:
            btnPlant.image.color  = inactiveColor;
            btnMove.image.color   = activeColor;
            btnDelete.image.color = inactiveColor;
            break;

        case EnumScript.State.Delete:
            btnPlant.image.color  = inactiveColor;
            btnMove.image.color   = inactiveColor;
            btnDelete.image.color = activeColor;
            break;

        default:
            btnPlant.image.color  = inactiveColor;
            btnMove.image.color   = inactiveColor;
            btnDelete.image.color = inactiveColor;
            break;
        }
    }
Пример #2
0
 private void Awake()
 {
     treeList           = new List <TreeData>();
     currentTree        = (EnumScript.Tree)ConstantScript.initial;
     currentView        = (EnumScript.View)ConstantScript.initial;
     activeState        = (EnumScript.State)ConstantScript.initial;
     treeId             = ConstantScript.initial;
     numberOfNormalTree = numberOfAppleTree = numberOfOrangeTree = ConstantScript.initial;
     letTreeMove        = false;
     isSave             = false;
     SwitchCamera(currentView);
     ShowPopupWindow(false);
     UpdateInformation();
 }