private void Awake() { if (_instance == null) { _instance = this; DontDestroyOnLoad(_instance); } else { Destroy(gameObject); } }
// Start is called before the first frame update void Start() { UnityEngine.Assertions.Assert.IsNotNull(marchesHandler, "Script egoutScript needs ref to MarchesHandler. obj : " + this.name); UnityEngine.Assertions.Assert.IsNotNull(bc, "Script egoutScript needs ref to BlobController. obj : " + this.name); UnityEngine.Assertions.Assert.IsNotNull(camera, "Script egoutScript needs ref to CameraMouvement. obj : " + this.name); var test = FindObjectsOfType <CheckPointsHandler>(); if (test.Length > 1 || test.Length < 0) { Debug.LogError("CheckPointsHandler not found in the scene @" + this.name); } cph = test[0]; }
// Start is called before the first frame update void Start() { //UnityEngine.Assertions.Assert.IsNotNull(cph, "Script DeathPoint needs ref to CheckPointsHandler. obj : " + this.name); var test = FindObjectsOfType <CheckPointsHandler>(); if (test.Length > 1 || test.Length < 0) { Debug.LogError("CheckPointsHandler not found in the scene @" + this.name); } cph = test[0]; if (crunchDeath) { rb = gameObject.GetComponent <Rigidbody2D>(); } }
// Start is called before the first frame update void Start() { var test = FindObjectsOfType <CheckPointsHandler>(); if (test.Length > 1 || test.Length < 0) { Debug.LogError("CheckPointsHandler not found in the scene @" + this.name); } cph = test[0]; alarm = GetComponents <AudioSource>()[0]; cardiogram = GetComponents <AudioSource>()[1]; smallBip = GetComponents <AudioSource>()[2]; timeToBip = timerBase; safeTime = safeTimeBase; gyrophareHandler = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <GyrophareHandler>(); hand.gameObject.SetActive(false); }
private void Start() { _audioSource = GetComponent <AudioSource>(); _gameMaster = GameObject.FindGameObjectWithTag("gameMaster").GetComponent <CheckPointsHandler>(); _spriteRenderer = GetComponentInChildren <SpriteRenderer>(); }
private void Start() { checkPointHandler = GameObject.FindGameObjectWithTag("gameMaster").GetComponent <CheckPointsHandler>(); transform.position = checkPointHandler.lastCheckPointPos; }
// Start is called before the first frame update void Start() { Handler = GetComponentInParent <CheckPointsHandler>(); }
private void Awake() { rb = this.GetComponent <Rigidbody>(); inputController = this.GetComponent <CharacterInput>(); checkpointHandler = this.GetComponent <CheckPointsHandler>(); }