// Gets difficulty from the main menu scene. private void GetDifficultyFromMain() { GameObject difficultyGameObject = GameObject.FindWithTag("Difficulty"); if (difficultyGameObject != null) { DifficultyScript difficultyScript = difficultyGameObject.GetComponent <DifficultyScript>(); switch (difficultyScript.GetDifficulty()) { case "easy": difficulty = Difficulty.Easy; break; case "medium": difficulty = Difficulty.Medium; break; case "hard": difficulty = Difficulty.Hard; break; default: difficulty = Difficulty.Easy; break; } } else { difficulty = Difficulty.Easy; } }
private void Awake() { strumValue = 0.0f; eventSystem = GetComponent <EventSystem>(); difficultyScript = difficultyGameObject.GetComponent <DifficultyScript>(); audioManagerScript = audioManager.GetComponent <MainMenuAudioManager>(); LoadMainMenu(); }
private void Awake() { if (Instance) { DestroyImmediate(gameObject); } else { DontDestroyOnLoad(gameObject); Instance = this; } }
// Use this for initialization void Start() { cannonScript = cannonObject.GetComponent <CannonScript>(); source = this.GetComponent <AudioSource>(); ghostShip = ghostShipObject.GetComponent <GhostShipScript>(); ghost = ghostObject.GetComponent <GhostScript>(); difficultyScript = GameObject.FindGameObjectWithTag("Difficulty").GetComponent <DifficultyScript>(); if (difficultyScript.isLegendaryMode == true) { ghost.GetComponentInChildren <SkinnedMeshRenderer>().material = legendaryGhost; ghost.LegendaryGhost(); } }
private void Start() { //get the screen height and width based on camera (located in center of page) Camera cam = FindObjectOfType <Camera>(); height = 2f * cam.orthographicSize; width = height * cam.aspect; //get the animator for messing with animations animator = gameObject.GetComponent <Animator>(); audioSource = gameObject.GetComponent <AudioSource>(); difficultyScript = GameObject.FindGameObjectWithTag("GameController").GetComponent <DifficultyScript>(); }
void Update() { DifficultyScript.elapsedTime = Time.time - time; speed = Mathf.Lerp(speedMinMax.x, speedMinMax.y, DifficultyScript.GetDifficultyPercent()); follower.followSpeed = speed * 5f; if (Input.GetKeyDown(KeyCode.Q)) { ArrayTest2(); } if (Input.GetKeyDown(KeyCode.W)) { ArrayTest(); } }
void Update() { #region TEST INPUT /* * if (Input.GetKeyDown(KeyCode.Keypad4)) * { * StartMovement(); * }*/ /* * if (Input.GetKeyDown(KeyCode.Q)) * { * RestartSpeed(); * }*/ #endregion DifficultyScript.elapsedTime = Time.time - time; speed = Mathf.Lerp(speedMinMax.x, speedMinMax.y, DifficultyScript.GetDifficultyPercent()); follower.followSpeed = speed; }
public void Start() { _DiffControlScript = FindObjectOfType <DifficultyScript>(); _gameControlScript = FindObjectOfType <GameControlScript> (); }