public void Collect() { SCR_collectableSpawner.collectableTotal--; SCR_collectableSpawner.spawnPointOccupied[spawnSlot] = 0; isActive = false; fadeCounter = 1.5f; if (collectEffectObj) { GameObject collectEffectInst = Instantiate(collectEffectObj, transform.position, Quaternion.identity) as GameObject; } if (SND_collect) { SND_collect.PlaySound(); if (collectPoints == true) { SCR_main.score += points; if (SCR_main.pOn) { SCR_text p = SCR_gui.CreateText("PopUpPoints", Vector3.zero); p.UpdateText(points.ToString()); p.SetWorldPos(transform.position, 1f); p.SetFadeSpeed(0.55f, 0.2f); } } } flashOn = true; DisplayFlash(); }
void ShowHUD(bool com) { if (com) { SCR_gui.CreateText("ScoreText", Vector3.zero); scoreObj = SCR_gui.CreateText("ScoreNumber", Vector3.zero); if (stageTimer == true) { SCR_gui.CreateText("TimerText", Vector3.zero); SCR_gui.CreateText("TimerNumber", Vector3.zero); startTimer = true; GameObject t = GameObject.Find("TimerNumber"); guitimer = t.GetComponent <GUIText>(); StartCoroutine(timerUpdate()); } DisplayScore(); } else { SCR_gui.RemoveText("ScoreText"); SCR_gui.RemoveText("ScoreNumber"); SCR_gui.CreateText("TimerText", Vector3.zero); SCR_gui.CreateText("TimerNumber", Vector3.zero); startTimer = false; } }
void UpdateState() { stateCounter += Time.deltaTime; if (state == 10) { if (stateCounter >= 0.4f) { SCR_gui.CreateIcon("GameComplete", Vector3.zero); StateNext(); } } if (state == 11) { if (stateCounter >= 0.2f) { SCR_gui.CreateText("GameComplete", Vector3.zero); StateNext(); } } if (state == 12) { if (stateCounter >= 0.4f) { SCR_gui.CreateText("GameCompleteScoreText", Vector3.zero); SCR_text score = SCR_gui.CreateText("GameCompleteScoreNumber", Vector3.zero); score.UpdateText(SCR_main.score.ToString()); StateNext(); } } if (state == 13) { if (stateCounter >= 0.4f) { SCR_gui.CreateOption("GameCompleteReturn", new Vector2(0.5f, 0.15f)); state = 0; } } }
void Awake() { SCR_gui.CreateScreenCover(0); SCR_gui.CreateText("PlayerSelect", Vector3.zero); if (skyBoxMaterial) { RenderSettings.skybox = skyBoxMaterial; } GameObject m = GameObject.Find("MAIN"); SCR_main main = m.GetComponent <SCR_main>(); if (playerSelectMusic && SCR_main.hMusic) { m.GetComponent <SCR_music>().PlayMusic(playerSelectMusic); } SCR_main.level = 1; }
void UpdateAction() { character.SetRotAngle(currentTargetEnemy.transform.position); actionCounter += Time.deltaTime; if (action == 0 || action == 1) { if (action == 0) { character.speed[1] = (character.dir * character.runSpeed); if (actionCounter >= actionLimit) { SetAction(1); } } else { if (actionCounter >= actionLimit) { SetAction(0); } } character.SetRotTarget(); CheckPlayerDistance(1); } else { if (action == 2) { //ready to attack character.SetRotTarget(); if (actionCounter >= actionLimit) { SetAction(3); } CheckPlayerDistance(2); } else { if (action == 10) { //dying if (actionCounter >= 1.25f) { if (SCR_main.pOn) { SCR_text p = SCR_gui.CreateText("PopUpPoints", Vector3.zero); p.UpdateText(points.ToString()); p.SetWorldPos(transform.position, 1f); p.SetFadeSpeed(0.55f, 0.2f); } SetAction(11); character.StartFlash(1, 1000); GetComponent <BoxCollider>().isTrigger = true; } } else { if (action == 11) { //vanishing if (actionCounter >= 0.55f) { SCR_main.DestroyObj(gameObject); } } } } } }
void OpenMenu(int com) { Vector2 optionPos; if (com == 0) { //TITLE SCR_input.rightClickAction = -1; SCR_gui.CreateIcon("Title", Vector3.zero); optionPos = new Vector2(0.5f, 0.6f); SCR_gui.CreateOption("StartGame", optionPos); optionPos += SCR_gui.optionSpacing; if (SCR_main.hsOn) { SCR_gui.CreateOption("HighScores", optionPos); optionPos += SCR_gui.optionSpacing; } SCR_gui.CreateOption("Options", optionPos); SCR_gui.CreateIcon("Controls", Vector3.zero); } if (com == 1) { //OPTIONS SCR_input.rightClickAction = 0; SCR_gui.CreateIcon("Options", Vector3.zero); optionPos = new Vector2(0.5f, 0.575f); SCR_gui.CreateOption("ChangeSoundFX", optionPos); optionPos += SCR_gui.optionSpacing; if (SCR_main.hMusic) { SCR_gui.CreateOption("ChangeMusic", optionPos); optionPos += SCR_gui.optionSpacing; } SCR_gui.CreateOption("WipeData", optionPos); optionPos += SCR_gui.optionSpacing; SCR_gui.CreateOption("OptionsReturn", optionPos); } if (com == 2) { //WIPE DATA SCR_input.rightClickAction = 2; SCR_gui.CreateIcon("WipeData", Vector3.zero); optionPos = new Vector2(0.5f, 0.5f); SCR_gui.CreateOption("WipeDataYes", optionPos); optionPos += SCR_gui.optionSpacing; SCR_gui.CreateOption("WipeDataNo", optionPos); } if (com == 3) { //HIGH SCORES SCR_input.rightClickAction = 0; SCR_gui.CreateIcon("HighScores", Vector3.zero); float highScoreY = 0.7f; float highScoreSpacing = -0.045f; float rankX = 0.475f; float scoreX = 0.525f; for (int i = 0; i < SCR_main.highScore.Count; i++) { SCR_text tRank = SCR_gui.CreateText("HighScoreRank", new Vector3(rankX, highScoreY, 0f)); tRank.UpdateText((i + 1).ToString()); SCR_text tScore = SCR_gui.CreateText("HighScoreNumber", new Vector3(scoreX, highScoreY, 0f)); tScore.UpdateText(SCR_main.highScore[i].ToString()); highScoreY += highScoreSpacing; } SCR_gui.CreateOption("HighScoresReturn", new Vector2(0.5f, 0.15f)); } }