public static GameObject Instantiate_And_AssignAutoVariables <T>(this T mb, GameObject original, Vector3 position, Quaternion rotation) where T : MonoBehaviour { var newObj = GameObject.Instantiate(original); AutoAttributeManager.AutoReference(newObj); return(newObj); }
public static GameObject Instantiate_And_AssignAutoVariables <T>(this T mb, GameObject original, Transform parent, bool instantiateInWorldSpace) where T : MonoBehaviour { var newObj = GameObject.Instantiate(original, parent, instantiateInWorldSpace); AutoAttributeManager.AutoReference(newObj); return(newObj); }
public static T AddComponent_Auto <T>(this GameObject go) where T : MonoBehaviour { T newComponent = go.AddComponent <T>(); AutoAttributeManager.AutoReference(newComponent); return(newComponent); }
private void RecursivelyReferenceChildren(GameObject go) { AutoAttributeManager.AutoReference(go); foreach (Transform child in this.transform) { RecursivelyReferenceChildren(child.gameObject); } }
public static GameObject Instantiate_And_AssignAutoVariables <T>(this T mb, GameObject original) where T : MonoBehaviour { var newObj = GameObject.Instantiate(original); AutoAttributeManager.AutoReference(newObj); Debug.Log("AutoAssignment Complete"); return(newObj); }
void Awake() { AutoAttributeManager.AutoReference(this.gameObject); if (alsoReferenceChildren) { foreach (Transform child in this.transform) { AutoAttributeManager.AutoReference(child.gameObject); } } }
void RunTest() { AutoAttributeManager.AutoReference(this); Assert.IsNotNull(myChildrenCollidersArr); Assert.IsNotNull(MyChildrenCollidersArr); Assert.AreEqual(1, myParentCollidersArr.Length); //Parent of this object has one collider Assert.IsNotNull(myChildrenCollidersList); Assert.IsNotNull(myLight); //Child has light component Assert.AreEqual(2, myChildrenCollidersArr.Length); //This gameobject has 2 children colliders Assert.AreEqual(2, MyChildrenCollidersArr.Length); //This gameobject has 2 children colliders Assert.AreEqual(2, myChildrenCollidersList.Count); }