Пример #1
0
 void Awake()
 {
     playerPosColor = SceneTypeManager.Instance().SelectColor(SceneTypeManager.Instance().currentType);
     mapManager     = MapManager.Instance();
     dataManager    = DataManager.Instance();
     gameControl    = GameControl.Instance();
 }
Пример #2
0
 void Start()
 {
     mapWall        = Resources.Load("wall") as GameObject;
     mapTile        = Resources.Load("tile") as GameObject;
     mapCoin        = Resources.Load("coin") as GameObject;
     mapSkySpikes   = Resources.Load("skySpikes") as GameObject;
     mapSpikes      = Resources.Load("spikes") as GameObject;
     mapColor       = SceneTypeManager.Instance().SelectColor(SceneTypeManager.Instance().currentType);
     mapConstant    = Constant.Instance();
     mapProbability = ProbabilityManager.Instance();
     CreateMap();
     player = GameObject.Instantiate(Resources.Load(SceneTypeManager.Instance().playerName) as GameObject);
 }
Пример #3
0
 public void SaveScore()
 {
     PlayerPrefs.SetInt("COIN_SCORE", coinScroe);
     if (SceneTypeManager.Instance().GameMode == Constant.Instance().CHANLLENGE)
     {
         PlayerPrefs.SetInt("LAST_GAME_CHANLLENGE_SCORE", gameScroe);
         if (gameScroe > PlayerPrefs.GetInt("BEST_GAME_CHANLLENGE_SCORE", 0))
         {
             PlayerPrefs.SetInt("BEST_GAME_CHANLLENGE_SCORE", gameScroe);
         }
     }
     else
     {
         PlayerPrefs.SetInt("LAST_GAME_SCORE", gameScroe);
         if (gameScroe > PlayerPrefs.GetInt("BEST_GAME_SCORE", 0))
         {
             PlayerPrefs.SetInt("BEST_GAME_SCORE", gameScroe);
         }
     }
 }
Пример #4
0
 void Start()
 {
     UIConfig.defaultFont = "Blackentina 4F";
     UIConstant           = Constant.Instance();
     dataManager          = DataManager.Instance();
     gameControl          = GameControl.Instance();
     musicManager         = MusicManager.Instance();
     GRoot.inst.SetContentScaleFactor(UIConstant.HEIGHT, UIConstant.WIDE);
     UIPackage.AddPackage("UI/主界面");
     componentNormal = UIPackage.CreateObject("界面UI", "普通模式").asCom;
     GRoot.inst.AddChild(componentNormal);
     componentGameOver = UIPackage.CreateObject("界面UI", "游戏结束").asCom;
     GRoot.inst.AddChild(componentGameOver);
     componentGameOver.visible = false;
     buttonSound     = componentNormal.GetChild("button_sound").asButton;
     buttonPause     = componentNormal.GetChild("button_pause").asButton;
     buttonPlay      = componentNormal.GetChild("button_play").asButton;
     buttonLeft      = componentNormal.GetChild("button_left").asButton;
     buttonRight     = componentNormal.GetChild("button_right").asButton;
     buttonQuit      = componentNormal.GetChild("button_quit").asButton;
     textScore       = componentNormal.GetChild("text_score").asTextField;
     textCoin        = componentNormal.GetChild("text_coin").asTextField;
     textTime        = componentNormal.GetChild("text_time").asTextField;
     clock           = componentNormal.GetChild("clock").asImage;
     textEndScore    = componentGameOver.GetChild("text_end_score").asTextField;
     buttonReplay    = componentGameOver.GetChild("button_replay").asButton;
     clockTransition = componentNormal.GetTransition("clock_t");
     buttonPlay.onClick.Add(ButtonPlayClick);
     buttonPause.onClick.Add(ButtonPauseClick);
     buttonSound.onClick.Add(ButtonSoundClick);
     buttonLeft.onClick.Add(ButtonLeftClick);
     buttonRight.onClick.Add(ButtonRightClick);
     buttonReplay.onClick.Add(ButtonRePlayClick);
     buttonQuit.onClick.Add(ButtonQuitClick);
     if (SceneTypeManager.Instance().GameMode == Constant.Instance().CHANLLENGE)
     {
         textTime.visible = true;
         clock.visible    = true;
         StartCoroutine(CountTime());
     }
 }
Пример #5
0
 void Start()
 {
     sceneManager    = SceneTypeManager.Instance();
     mySpikes        = sceneManager.SelectColor(sceneManager.currentType);
     childTransfrom  = transform.Find("spikes_b").GetComponent <Transform>();
     childTransfrom2 = transform.Find("spikes_a").GetComponent <Transform>();
     gameObject.GetComponent <MeshRenderer>().material.color = mySpikes.colorOfSpikes;
     childTransfrom.gameObject.GetComponent <MeshRenderer>().material.color  = mySpikes.colorOfSpikes;
     childTransfrom2.gameObject.GetComponent <MeshRenderer>().material.color = mySpikes.colorOfSpikes;
     initPos = childTransfrom.position;
     if (transform.gameObject.tag == "SkySpikes")
     {
         nextPos = childTransfrom.position + new Vector3(0, 0.6f, 0);
     }
     if (transform.gameObject.tag == "Spikes")
     {
         nextPos = childTransfrom.position + new Vector3(0, 0.15f, 0);
     }
     spikesConstant = Constant.Instance();
     StartCoroutine("UpAndDown");
 }
Пример #6
0
 void SelectBread()
 {
     SceneTypeManager.Instance().currentType = SceneTypeManager.ScenesType.SUNDAY;
     LoadGame();
 }
Пример #7
0
 void SelectWatermelon()
 {
     SceneTypeManager.Instance().currentType = SceneTypeManager.ScenesType.SATERDAY;
     LoadGame();
 }
Пример #8
0
 void SelectCake()
 {
     SceneTypeManager.Instance().currentType = SceneTypeManager.ScenesType.FRIDAY;
     LoadGame();
 }
Пример #9
0
 void SelectSushi()
 {
     SceneTypeManager.Instance().currentType = SceneTypeManager.ScenesType.THURSDAY;
     LoadGame();
 }
Пример #10
0
 void SelectBlock()
 {
     SceneTypeManager.Instance().currentType = SceneTypeManager.ScenesType.WENESDAY;
     LoadGame();
 }
Пример #11
0
 void SelectCheese()
 {
     SceneTypeManager.Instance().currentType = SceneTypeManager.ScenesType.TUESDAY;
     LoadGame();
 }
Пример #12
0
 void SelectMushRoom()
 {
     SceneTypeManager.Instance().currentType = SceneTypeManager.ScenesType.MONDAY;
     LoadGame();
 }
Пример #13
0
 void LoadChanllengeScene()
 {
     MainGameInitLoad();
     SceneTypeManager.Instance().GameMode = Constant.Instance().CHANLLENGE;
 }