private void OnDestroy() { Interactible I = GetComponent <Interactible>(); if (I != null) { I.OnInteract -= I_OnInteract; } }
private void Start() { RB = GetComponent <Rigidbody2D>(); Interactible I = GetComponent <Interactible>(); if (I != null) { I.OnInteract += I_OnInteract; } }
private void Start() { Interactible I = GetComponent <Interactible>(); if (I == null) { Debug.Log("Nothing to interact with! Can be ignored"); } else { I.OnInteract += I_OnInteract; } }
private void Start() { Interactible I = GetComponent <Interactible>(); if (I == null) { Debug.Log("Nothing to interact with! Can be ignored"); } else { I.OnInteract += I_OnInteract; } SM = MM.GetComponentInChildren <Menu.StoryModeUI>(true); //Cannot find it if its in DONOTDESTROY? if (SM == null) { Debug.Log("No story mode window found :("); } //Best to find it in static class, having an actual global time manager would be best. }
private void Start() { Interactible I = GetComponent <Interactible>(); if (I != null) { I.OnInteract += I_OnInteract; } else { Debug.Log("Cant find Interactible!"); } LS = GetComponent <General.ListAnimation>(); if (LS == null) { Debug.Log("Dont forget ListAnimation"); Destroy(this); } }