void makeGameMode() { string modePlayerString = getGameMode(); //print ( "The GameMode IS "+ modePlayerString); try { if (!string.IsNullOrEmpty(modePlayerString)) { this.gameObject.AddComponent(System.Type.GetType(modePlayerString)); } } catch (System.Exception C) { print(C.Message); } playModeNow = this.GetComponent <playModeBasic> (); if (playModeNow) { playModeNow.OnGameStart(); } string effectForAdd = getGameModeExtraEffect(); //print (effectForAdd +" is for add" ); if (!string.IsNullOrEmpty(effectForAdd)) { systemValues.thePlayer.gameObject.AddComponent(System.Type.GetType(effectForAdd)); } }
//反复跳转场景应该做一些清理工作 public static void makeSystemClean() { if (thePlayer) { thePlayer.Effects.Clear(); } playModeNow = null; gameModeIndexNow = 0; sceneSelectFlash(); soulCount = 7; //回到初始,给7个灵力 Cursor.visible = true; Time.timeScale = 1f; isGamming = true; theShowingTexts.Clear(); theSavedSprite.Clear(); thePopSoul.Clear(); messageBoxClose(); theAreaRenders.Clear(); wulingButton.isStarted = false; isGamming = true; }