void Init() { if (!isInit) { isInit = true; defaultColor = SharpMocha.WHITE; defaultColor.a = alphaValue; greenColor = SharpMocha.GREEN; greenColor.a = alphaValue; redColor = SharpMocha.RED; redColor.a = alphaValue; GameObject controller = GameObject.GetGameObjectByName(Common.prefix + "PuzzleRoom3", false); if (controller != null) { controllerScript = GetScript <DeathPanelController>(controller); } else { Logger.Log("Unable to find DeathPanelController"); } GameObject obj = Common.GetChildByName(gameObject, Common.prefix + "DeathPanelScreen"); screen = obj.RequireComponent <CForwardRenderer>(); obj = Common.GetChildByName(gameObject, Common.prefix + "DeathPanelText"); numberText = obj.RequireComponent <CFontRenderer>(); } }
public void RespawnToCheckpoint() { // Differentiate by checkpoint name if (gameObject.GetName() == "Checkpoint1a") { // Reset booby trap event and Unlock door to area 1B GameObject boobyControllerObj = GameObject.GetGameObjectByName("TSR_TrapController");//trapControllerName); BoobyTrapDeactivatorController controllerScript = GetScript <BoobyTrapDeactivatorController>(boobyControllerObj); controllerScript.ResetUponDeathOfPlayer(); } else if (gameObject.GetName() == "Checkpoint3") { // Reset panels event GameObject deathControllerObj = GameObject.GetGameObjectByName("PuzzleRoom3");//trapControllerName); DeathPanelController controllerScript = GetScript <DeathPanelController>(deathControllerObj); controllerScript.ResetUponDeathOfPlayer(); } // Reset the console screen Common.GetConsoleScreenScript().RestoreToSavedState(); }
void Init() { if (!isInit) { isInit = true; defaultColor = SharpMocha.WHITE; defaultColor.a = alphaValue; greenColor = SharpMocha.GREEN; greenColor.a = alphaValue; redColor = SharpMocha.RED; redColor.a = alphaValue; GameObject controller = GameObject.GetGameObjectByName(Common.prefix + "PuzzleRoom3", false); if (controller != null) controllerScript = GetScript<DeathPanelController>(controller); else Logger.Log("Unable to find DeathPanelController"); GameObject obj = Common.GetChildByName(gameObject, Common.prefix + "DeathPanelScreen"); screen = obj.RequireComponent<CForwardRenderer>(); obj = Common.GetChildByName(gameObject, Common.prefix + "DeathPanelText"); numberText = obj.RequireComponent<CFontRenderer>(); } }