예제 #1
0
 private void Awake()
 {
     //initialize the object references in UIManagement
     UIManagement.Initialize();
     //load the avatar sprites from Resources
     AvatarDisplay.LoadSprites();
     //set the state list into a dictionary
     _stateDict = _states.ToDictionary(s => s.Name, s => s.GameObject);
     //default to the main menu state
     GoToState(State.MainMenu);
     //instantiate RAGE objects if in RAGE mode
     if (GameManagement.RageMode)
     {
         foreach (var obj in GameManagement.PlatformSettings.RageObjects)
         {
             var newObj = Instantiate(obj);
             newObj.name = obj.name;
         }
     }
     //if this is a reload after a tutorial, attempt to reload straight away
     if (_reload)
     {
         Loading.Start();
         GameManagement.GameManager.LoadGameTask(GameManagement.GameSavePath, GameManagement.TeamName, success =>
         {
             if (success)
             {
                 GoToState(State.TeamManagement);
                 _reload = false;
             }
             Loading.Stop();
         });
     }
 }