// Use this for initialization void Awake() { music = GetComponent <SCR_music>(); GetComponent <SCR_gui>().StartUp(); healthBarObj = Resources.Load("Objects/Gui/OBJ_healthBar", typeof(GameObject)) as GameObject; soundObj = Resources.Load("Objects/Control/OBJ_sound", typeof(GameObject)) as GameObject; particleMat = new Material[2] { Resources.Load("Materials/Effect/MAT_particleAlpha", typeof(Material)) as Material, Resources.Load("Materials/Effect/MAT_particleAdditive", typeof(Material)) as Material }; pOn = pointsOn; hsOn = highScoresOn; hMusic = hasMusic; sName = stageName; hCursor = hideMouseCursor; DontDestroyOnLoad(transform.gameObject); Application.targetFrameRate = 60; UpdateScreenMult(); GetComponent <SCR_input>().StartUp(); //ResetData(); //SaveAll(); if (PlayerPrefs.HasKey("fxOn")) { LoadData(); } else { ResetData(); SaveAll(); } LoadScene(); }
// Use this for initialization void Awake() { music=GetComponent<SCR_music>(); GetComponent<SCR_gui>().StartUp(); healthBarObj=Resources.Load("Objects/Gui/OBJ_healthBar",typeof(GameObject)) as GameObject; soundObj=Resources.Load("Objects/Control/OBJ_sound",typeof(GameObject)) as GameObject; particleMat=new Material[2]{ Resources.Load("Materials/Effect/MAT_particleAlpha",typeof(Material)) as Material, Resources.Load("Materials/Effect/MAT_particleAdditive",typeof(Material)) as Material }; pOn=pointsOn; hsOn=highScoresOn; hMusic=hasMusic; sName=stageName; hCursor=hideMouseCursor; DontDestroyOnLoad(transform.gameObject); Application.targetFrameRate=60; UpdateScreenMult(); GetComponent<SCR_input>().StartUp(); //ResetData(); //SaveAll(); if(PlayerPrefs.HasKey("fxOn")){ LoadData(); } else { ResetData(); SaveAll(); } LoadScene(); }
void Awake() { GameObject m = GameObject.Find("MAIN"); main = m.GetComponent <SCR_main>(); music = m.GetComponent <SCR_music>(); if (stageMusic && SCR_main.hMusic) { music.PlayMusic(stageMusic); } SCR_input.playerControlActive = false; pauseAllowed = false; paused = false; SCR_main.scoreRec = SCR_main.score; scoreRec = SCR_main.score; GameObject camInst = Instantiate(stageCamera, Vector3.zero, Quaternion.identity) as GameObject; GameObject spawnPointPlayer = GameObject.Find("SpawnPointPlayer"); Vector3 playerPos = new Vector3(spawnPointPlayer.transform.position.x, 0f, spawnPointPlayer.transform.position.z); if (main.playerSelect == true) { GameObject playerInst = Instantiate(main.playerObj1, playerPos, Quaternion.identity) as GameObject; Destroy(spawnPointPlayer); player = playerInst.GetComponent <SCR_character>(); SetupStageSize(); cam = camInst.GetComponent <SCR_camStage>(); cam.SetTarget(playerInst.transform); cam.InitiateStage(0); } else if (main.playerSelect == false) { GameObject playerInst = Instantiate(main.playerObj2, playerPos, Quaternion.identity) as GameObject; Destroy(spawnPointPlayer); player = playerInst.GetComponent <SCR_character>(); SetupStageSize(); cam = camInst.GetComponent <SCR_camStage>(); cam.SetTarget(playerInst.transform); cam.InitiateStage(0); } if (skyBoxMaterial) { RenderSettings.skybox = skyBoxMaterial; } if (SCR_main.hCursor) { Cursor.visible = false; } SetState(10); SCR_gui.CreateScreenCover(0); }
void Awake() { GameObject m=GameObject.Find ("MAIN"); main=m.GetComponent<SCR_main>(); music=m.GetComponent<SCR_music>(); if(stageMusic&&SCR_main.hMusic){ music.PlayMusic(stageMusic); } SCR_input.playerControlActive=false; pauseAllowed=false; paused=false; SCR_main.scoreRec=SCR_main.score; scoreRec=SCR_main.score; GameObject camInst=Instantiate(stageCamera,Vector3.zero,Quaternion.identity) as GameObject; GameObject spawnPointPlayer=GameObject.Find ("SpawnPointPlayer"); Vector3 playerPos=new Vector3(spawnPointPlayer.transform.position.x,0f,spawnPointPlayer.transform.position.z); if(main.playerSelect==true){ GameObject playerInst=Instantiate(main.playerObj1,playerPos,Quaternion.identity) as GameObject; Destroy(spawnPointPlayer); player=playerInst.GetComponent<SCR_character>(); SetupStageSize(); cam=camInst.GetComponent<SCR_camStage>(); cam.SetTarget(playerInst.transform); cam.InitiateStage(0); } else if(main.playerSelect==false){ GameObject playerInst=Instantiate(main.playerObj2,playerPos,Quaternion.identity) as GameObject; Destroy(spawnPointPlayer); player=playerInst.GetComponent<SCR_character>(); SetupStageSize(); cam=camInst.GetComponent<SCR_camStage>(); cam.SetTarget(playerInst.transform); cam.InitiateStage(0); } if(skyBoxMaterial){ RenderSettings.skybox=skyBoxMaterial; } if(SCR_main.hCursor){ Cursor.visible=false; } SetState (10); SCR_gui.CreateScreenCover(0); }