Beispiel #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();
    }
Beispiel #2
0
 public void OpenRepresentation(RepresentationObject repr)
 {
     if (currentRepresentation != null)
     {
         GameManager.Instance.loadingIndicator.InitLoadingIndicator();
         currentRepresentation.CloseRepresentation();
     }
     currentRepresentation = repr;
     currentRepresentation.OpenRepresentation();
     GameManager.Instance.loadingIndicator.DisableLoadingIndicator();
 }