Last active
March 25, 2019 16:04
-
-
Save James-Frowen/e4db3c0a281412ace6ca1c6462113bf0 to your computer and use it in GitHub Desktop.
Interface including useful methods of MonoBehaviour
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public interface IMonoBehaviour | |
{ | |
// Object | |
string name { get; } | |
// Component | |
GameObject gameObject { get; } | |
Transform transform { get; } | |
T GetComponent<T>(); | |
T GetComponentInChildren<T>(bool includeInactive = false); | |
T GetComponentInChildren<T>(); | |
T GetComponentInParent<T>(); | |
T[] GetComponents<T>(); | |
void GetComponents<T>(List<T> results); | |
void GetComponentsInChildren<T>(List<T> results); | |
T[] GetComponentsInChildren<T>(bool includeInactive); | |
void GetComponentsInChildren<T>(bool includeInactive, List<T> result); | |
T[] GetComponentsInChildren<T>(); | |
T[] GetComponentsInParent<T>(); | |
T[] GetComponentsInParent<T>(bool includeInactive); | |
void GetComponentsInParent<T>(bool includeInactive, List<T> results); | |
// Behaviour | |
bool enabled { get; set; } | |
bool isActiveAndEnabled { get; } | |
// MonoBehaviour | |
Coroutine StartCoroutine(IEnumerator routine); | |
void StopAllCoroutines(); | |
void StopCoroutine(IEnumerator routine); | |
void StopCoroutine(Coroutine routine); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment