public override void OnInspectorGUI() { manager = (EffectsManager)FindObjectOfType(typeof(EffectsManager)); if (manager != null) { if (manager.setNameArray != null) { if (manager.setArray[0] != null) { prevIndex = Instance.setIndex; Instance.setIndex = EditorGUILayout.Popup(Instance.setIndex, manager.setNameArray); if (prevIndex != Instance.setIndex) { // set all colliders of the same name to use the same set. Collider[] colliders = (Collider[])FindObjectsOfType(typeof(Collider)); foreach (Collider c in colliders) { if (c.name == Instance.transform.name) { if (c.GetComponent <UseEffects>()) { c.GetComponent <UseEffects>().setIndex = Instance.setIndex; } } } prevIndex = Instance.setIndex; } } else { EditorGUILayout.LabelField("No sets exist", ""); } } } if (GUI.changed) { EditorUtility.SetDirty(Instance); } }
void Awake() { effectsManager = GameObject.FindObjectOfType <EffectsManager>(); characterMotor = gameObject.GetComponent <CharacterMotorDB>(); source = gameObject.GetComponent <AudioSource>(); }
void Start() { effectsManager = GameObject.FindWithTag("Manager").GetComponent <EffectsManager>(); }
public static EffectsManager manager; //static access variable so other scripts can access this one. void Awake() { thePlayer = GameObject.FindWithTag("Player"); manager = this; }
void Awake() { effectsManagerScript = EffectsManager.manager; }