public static death Instance() { if (instance == null) { instance = new death(); } return(instance); }
void OnTriggerStay(Collider collider) { string objectName = collider.gameObject.name; if (objectName == "Player") { death d = collider.gameObject.GetComponent <death>(); d.isDeath = true; } }
// Update is called once per frame void Update() { Bounds b = transform.renderer.bounds; Bounds p = player.renderer.bounds; if (b.Intersects(p)) { death d = player.GetComponent <death>(); d.isDeath = true; } }
void Start() { gm = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GameScore>(); lm = FindObjectOfType <LoadMateri> (); ch = GameObject.Find("character"); rip = FindObjectOfType <death> (); cus = FindObjectOfType <flash> (); //thescoremanager = FindObjectOfType<scoremanager>(); }
void Awake() { // Making Sure there is a singleton of game maker if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } musicManager = GameObject.Find("musicManagerGamePlay"); gameplayMusic = musicManager.GetComponent <AudioSource>(); }
// Use this for initialization void Start() { rip = FindObjectOfType <death> (); }