/** * Initialization */ protected override void Start() { base.Start(); pauseMenu = GameObject.Find("Canvas").transform.Find("PauseMenu").gameObject; emotionController = this.gameObject.AddComponent <PlayerEmotionController>(); mode = PlayerPrefs.GetInt("TestMode"); if (!PlayerPrefs.GetString("PlayerName").Equals("Default")) { CreateFile(); } trail = player.GetComponentInChildren <ParticleSystem>(); trail.Pause(); startTime = Time.time; spendingTime = delay; saveDelay = 0.5f; if (mode == 1) { CoinLevel(); } else if (mode == 2) { TrapLevel(); } }
/** * Initialization */ protected override void Start() { base.Start(); pauseMenu = GameObject.Find("Canvas").transform.Find("PauseMenu").gameObject; emotionController = this.gameObject.AddComponent <PlayerEmotionController>(); musicController = FindObjectOfType <MusicController>(); trail = player.GetComponentInChildren <ParticleSystem>(); trail.Pause(); emotionName = "null"; playerRenderer = player.GetComponent <Renderer>(); targetColor = playerRenderer.material.color; initialColor = playerRenderer.material.color; //Anger and Surprise increase the number of traps, Joy and Sadness increase the number of coins emotionFeedback = new Dictionary <string, Feedback>() { { "Anger", FeedbackTrap }, { "Surprise", FeedbackCoin }, { "Joy", FeedbackCoin }, { "Sadness", FeedbackTrap } }; playerColors = new Dictionary <string, Color>() { { "Anger", new Color(1, 0, 0) }, { "Surprise", new Color(0, 1, 0) }, { "Joy", new Color(1, 1, 0) }, { "Sadness", new Color(0, 0, 1) } }; SetPlayerColors(); // WARNING : OBSOLETE, USED FOR THE 4 TEST LEVELS SYSTEM /* * if (PlayerPrefs.GetInt("RandomMode") == 0) * { * SetPlayerColors(); * ChangeEmotionFeedbak(); * } * else if (PlayerPrefs.GetInt("RandomMode") == 1) ChangeEmotionFeedbakRandom(); */ // WARNING : END }