예제 #1
0
    void Start()
    {
        hierarchyRepresentation.CloseRepresentation();
        OpenRepresentation(buildingsRepresentation);
        UnityAction[] actions = new UnityAction[2];
        actions[0] = () =>
        {
            if (currentRepresentation != buildingsRepresentation)
            {
                GameManager.Instance.StartCoroutine(
                    GameManager.Instance.DecorateActionWithSwitcher(() => OpenRepresentation(buildingsRepresentation)));
            }
        };
        actions[1] = () =>
        {
            if (currentRepresentation != hierarchyRepresentation)
            {
                GameManager.Instance.StartCoroutine(
                    GameManager.Instance.DecorateActionWithSwitcher(() => OpenRepresentation(hierarchyRepresentation)));
            }
        };

        switchReprButtons.InitActions(actions, 0);

        SetDefaultState();
    }
예제 #2
0
    // Start is called before the first frame update
    void Awake()
    {
        Instance = this;
        UnityEngine.Events.UnityAction [] actions = new UnityEngine.Events.UnityAction[2];
        actions[0] = () => { SwitchStatsAndActions(true); };
        actions[1] = () => { SwitchStatsAndActions(false); };
        actionsStatsButton.InitActions(actions, 0);
        actions[0].Invoke();

        myPanel.AddActionToButton(new UnityAction(() =>
        {
            if (GameManager.Instance.representationManager.currentRepresentation == GameManager.Instance.representationManager.buildingsRepresentation)
            {
                (GameManager.Instance.representationManager.buildingsRepresentation as MapRepresentation).DeselectAll();
            }
        }));
    }