// Use this for initialization void Start() { time = 0; player_go = GameObject.FindGameObjectWithTag("Player"); //camera = this.GetComponent<Camera>(); if (player_go == null) { Debug.Log("could not find player"); return; } //player = player_go.transform; playerScript = player_go.GetComponent <Player>(); retry = false; death = false; stayRef = GameObject.Find("StayObj").GetComponent <StayScript>(); if (stayRef.getPlayCount() < 1) { transform.position = new Vector3(this.transform.position.x, 13.7f, this.transform.position.z); } Shaking = false; doOnce = false; offset = transform.position - player_go.transform.position; }
void Awake() { myCam = GameObject.Find("Main Camera").GetComponent <CameraScript>(); soundRef = GameObject.Find("Sound").GetComponent <SoundScript>(); stayRef = GameObject.Find("StayObj").GetComponent <StayScript>(); lvlManagerRef = GameObject.Find("LevelManager").GetComponent <LevelManager>(); }
void Awake() { if (instance) { DestroyImmediate(gameObject); } else { DontDestroyOnLoad(this); instance = this; gamesPlayed = 0; } }
// Use this for initialization void Start() { treadMill = GameObject.Find("Treadmill").GetComponent <TreadmillScript>(); StartCoroutine(RecSwitch()); player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerScript>(); stayRef = GameObject.Find("StayObj").GetComponent <StayScript>(); source = GetComponent <AudioSource>(); //PlayerPrefs.SetInt("HighScore", 60); source.PlayOneShot(camCorder, 0.7f); //source.PlayOneShot(themeSong, 0.35f); source.PlayOneShot(NightSounds, 0.55f); //wait = themeSong.length; wait2 = NightSounds.length; incOnce = false; }