Exemple #1
0
    private IEnumerator Start()
    {
        StateMachine = GetComponent <StateMachine>();
        _buildingEnvironmatentState = gameObject.AddComponent <BuildingEnvironmatentState>();
        _setupAnimationsState       = gameObject.AddComponent <SetupAnimationsState>();
        _editEnvironmentState       = gameObject.AddComponent <EditEnvironmentState>();
        _viewModeState = gameObject.AddComponent <ViewModeState>();

        StateMachine.States.Add(_buildingEnvironmatentState);
        StateMachine.States.Add(_setupAnimationsState);
        StateMachine.States.Add(_editEnvironmentState);
        StateMachine.States.Add(_viewModeState);

        StateMachine.CurrentState = _viewModeState;
        StateMachine.CurrentState.ActivateState();

        DontDestroy = FindObjectOfType <DontDestroy>();

        while (EnvironmentResourcesManager.isReady == false)
        {
            yield return(null);
        }

        DeserializeSceneContent();
    }
Exemple #2
0
 public void LinkDependencies(SetupAnimationsState _setupAnimationsState)
 {
     DisplayToUser("Please select an object to start an animation setup");
     setupAnimationsState = _setupAnimationsState;
     setupAnimationsState.mouseInputEvent.AddListener(OnInputMouse);
 }