Beispiel #1
0
    void Start()
    {
        //reset level
        //reset scores

        playerConfigurationManager = PlayerConfigurationManager.Instance;
        currentPlayTime            = maxPlayTime;
        PlayerPrefs.SetInt("FirstRound", 1);

        //spawn manager
        spawnManager = GameObject.Find("CollectibleSpawnManager").GetComponent <CollectibleSpawnManager>();

        //Canvas objects
        mainTimerObj  = GameObject.Find("MainTimer");
        mainTimerText = mainTimerObj.GetComponent <TextMeshProUGUI>();
        mainTimerObj.SetActive(false);

        scoresObject = GameObject.Find("ScoresObject");
        scoresObject.SetActive(false);

        //Victory screen
        victoryCanvas.SetActive(false);

        AudioManager = AudioManager.Instance;
        AudioManager.PlaySound("LevelTrack");
        AudioManager.StopSound("MenuTrack");
    }
Beispiel #2
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(Instance);
         _PlayerConfigs = new List <PlayerConfiguration>();
     }
 }
 private void Awake()
 {
     if (Instance != null)
     {
         Debug.Log("Singleton - trying to create another instance of singleton");
     }
     else
     {
         Instance = this;
         DontDestroyOnLoad(Instance);
         playerConfigs = new List <PlayerConfiguration>();
     }
 }
Beispiel #4
0
 private void Awake()
 {
     if (Instance != null)
     {
         Debug.Log("[Singleton] Trying to instantiate a seccond instance of a singleton class.");
     }
     else
     {
         Instance = this;
         DontDestroyOnLoad(Instance);
         playerConfigs = new List <PlayerConfiguration>();
     }
 }
 //Create a Singleton of PlayerConfigurationManager
 private void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Debug.Log("SINGLETON ERROR!!!");
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
         DontDestroyOnLoad(Instance);
         playerConfigs = new List <PlayerConfiguration>();
     }
 }
Beispiel #6
0
 private void Awake()
 {
     //Create singleton and Don't Destroy on Load
     if (Instance != null)
     {
         Debug.Log("Creating an Instance");
     }
     else
     {
         Instance = this;             //Makes this object the only one in existence
         DontDestroyOnLoad(Instance); //keeps object from beiung destroyed across scenes
         PlayerConfigs = new List <PlayerConfiguration>();
     }
     //The following line of code will be used to change the map controls for each mini- game
     //   ControllerMapTest =  Instance.GetComponent<PlayerInputManager>().playerPrefab;
 }
Beispiel #7
0
    void Awake()
    {
        audioManager = AudioManager.Instance;
        playerConfigurationManager = PlayerConfigurationManager.Instance;
        playerId = input.user.index;
        audioManager.PlaySound("ButtonClick");

        //instantiate and disable text
        var menu = Instantiate(playerSetupMenuPrefab, playerConfigurationManager.waitingPanels[playerId].transform);

        playerConfigurationManager.waitingPanels[playerId].transform.GetChild(0).gameObject.SetActive(false);

        input.uiInputModule = menu.GetComponentInChildren <InputSystemUIInputModule>();
        menu.GetComponent <PlayerSetupMenuController>().SetPlayerIndex(input.playerIndex);
        menu.GetComponent <PlayerSetupMenuController>().GetInputReference(input);
    }
 private void Awake()
 {
     if (Instance != null)
     {
         Debug.Log("[Singleton] Trying to instantiate a seccond instance of a singleton class.");
         Destroy(gameObject);
         return;
     }
     else
     {
         Instance = this;
         DontDestroyOnLoad(Instance);
         players = new List <PlayerController>();
         GameSettings.selectedMap = (GameSettings.Map)Maybers.Prefs.Get("last map", (int)GameSettings.Map.SnowCastle);
     }
 }
Beispiel #9
0
 public void Awake()
 {
     if (Instance != null)
     {
         if (this != Instance)
         {
             Destroy(gameObject);
         }
     }
     else
     {
         Instance = this;
         DontDestroyOnLoad(Instance);
         playerConfigurations      = new List <PlayerConfiguration>();
         playerInputManager        = GetComponent <PlayerInputManager>();
         SceneManager.sceneLoaded += OnSceneLoaded;
     }
 }
    private void Awake()
    {
        AudioManager = AudioManager.Instance;
        levelManager = GameObject.Find("LevelManager").GetComponent <LevelManager>();
        animator     = GetComponent <Animator>();
        playerConfigurationManager = PlayerConfigurationManager.Instance;
        playerConfigs = playerConfigurationManager.GetPlayerConfigs();

        levelRepetitions = levelManager.levelRepetitions;
        numberOfPlayers  = playerConfigurationManager.CountActivePlayers();

        animationFinished = false;


        InstantiatePlayersScoreReference();
        InstantiateVictoryStars();
        roundEndedCanvas.SetActive(true);
    }
Beispiel #11
0
 private void Start()
 {
     playerConfigurationManager = PlayerConfigurationManager.Instance;
 }