示例#1
0
 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);
     }
 }
示例#2
0
 void Awake()
 {
     effectsManager = GameObject.FindObjectOfType <EffectsManager>();
     characterMotor = gameObject.GetComponent <CharacterMotorDB>();
     source         = gameObject.GetComponent <AudioSource>();
 }
示例#3
0
 void Start()
 {
     effectsManager = GameObject.FindWithTag("Manager").GetComponent <EffectsManager>();
 }
示例#4
0
        public static EffectsManager manager;     //static access variable so other scripts can access this one.

        void Awake()
        {
            thePlayer = GameObject.FindWithTag("Player");
            manager   = this;
        }
示例#5
0
 void Awake()
 {
     effectsManagerScript = EffectsManager.manager;
 }