public void OnStart() { GameObject panel = GameObject.GetGameObjectByName("PuzzleButton1").transform.GetChild(0).gameObject; panel1 = GetScript <BoobyTrapDeactivator>(panel); panel = GameObject.GetGameObjectByName("PuzzleButton2").transform.GetChild(0).gameObject; panel2 = GetScript <BoobyTrapDeactivator>(panel); panel = GameObject.GetGameObjectByName("PuzzleButton3").transform.GetChild(0).gameObject; panel3 = GetScript <BoobyTrapDeactivator>(panel); panel = GameObject.GetGameObjectByName("PuzzleButton4").transform.GetChild(0).gameObject; panel4 = GetScript <BoobyTrapDeactivator>(panel); trapLightW = GameObject.GetGameObjectByName("TrapLightW"); trapLightR1 = GameObject.GetGameObjectByName("TrapLightR1"); trapLightR1script = GetScript <PulsingLightScript>(trapLightR1); trapLightR2 = GameObject.GetGameObjectByName("TrapLightR2"); trapLightR2script = GetScript <PulsingLightScript>(trapLightR2); trapLightR3 = GameObject.GetGameObjectByName("TrapLightR3"); trapLightR3script = GetScript <PulsingLightScript>(trapLightR3); trapLightR4 = GameObject.GetGameObjectByName("TrapLightR4"); trapLightR4script = GetScript <PulsingLightScript>(trapLightR4); poisonGas = GameObject.GetGameObjectByName("TSR_PoisonGas"); gas = poisonGas.GetComponent <CParticleEmitter>(); gasScript = GetScript <TransformRiserScript>(poisonGas); GameObject boobyControllerObj = GameObject.GetGameObjectByName("TSR_TrapController");//trapControllerName); controllerScript = GetScript <BoobyTrapDeactivatorController>(boobyControllerObj); gasTimerShutdown = gas.mEmitterProperty.mMaxLifetime; mSound = gameObject.RequireComponent <CSound>(); }
public void OnStart() { smc = new StateMachineController(); lightsmc = new StateMachineController(); player = Common.GetStealthPlayer(); binds = GameObject.GetGameObjectByName("Monster4Binds"); attackParticle = GameObject.GetGameObjectByName("Monster4AttackParts").GetComponent <CParticleEmitter>(); attackParticle.setEnabled(false); poofParticle = GameObject.GetGameObjectByName("Monster4Poof").GetComponent <CParticleEmitter>(); mlight = gameObject.GetComponentInChildren <CLight>(); sound = gameObject.RequireComponent <CSound>(); screen = Common.GetConsoleScreenScript(); mesh = GameObject.GetGameObjectByName("M4Mesh").RequireComponent <CMeshRenderer>(); hunting = new State(smc, S_hunting_Start, S_hunting_Update, null); respawning = new State(smc, S_respawning_Start, null, S_respawning_End, RESPAWNTIME, hunting); attacking = new State(smc, S_attacking_Start, S_attacking_Update, S_attacking_End); attacking_intro = new State(smc, S_attacking_intro_Start, S_attacking_intro_Update, null, 1.0f, attacking); incoming = new State(smc, S_incoming_Start, S_incoming_Update, null, 3.0f, respawning); hurting = new State(smc, S_hurting_Start, S_hurting_Update, null, 1.0f, respawning); idle = new State(smc); dying = new State(smc, S_dying_Start, null, S_dying_End, 2.0f, idle); //light smc hold = new State(lightsmc, null, null, null); turningoff = new State(lightsmc, null, S_turningoff_Update, null, 0.5f, hold); turningon = new State(lightsmc, null, S_turningon_Update, null, 0.5f, hold); //binds smc bindssmc = new StateMachineController(); bindhold = new State(bindssmc, null, null, null); bindsmoveup = new State(bindssmc, S_bindsmoveup_Start, S_bindsmoveup_Update, null, 0.5f, bindhold); bindsmovedown = new State(bindssmc, null, S_bindsmovedown_Update, S_bindsmovedown_End, 0.5f, bindhold); helper = new MonsterHelper(); smc.SetState(respawning); lightsmc.SetState(hold); DisplayCorruption(); }