예제 #1
0
        void Reset()
        {
            MEventListener MeventL = GetComponent <MEventListener>();

            if (MeventL == null)
            {
                MeventL = gameObject.AddComponent <MEventListener>();
            }

            MeventL.Events = new System.Collections.Generic.List <MEventItemListener>(1)
            {
                new MEventItemListener()
            };

            var listener = MeventL.Events[0];

            listener.useTransform = true;
            listener.useVector3   = true;
            listener.useVoid      = false;

            listener.Event = MTools.GetInstance <MEvent>("Follow UI Transform");

            if (listener.Event != null)
            {
                UnityEditor.Events.UnityEventTools.AddPersistentListener(listener.ResponseTransform, SetTransform);
                UnityEditor.Events.UnityEventTools.AddPersistentListener(listener.ResponseVector3, SetScreenCenter);
            }
        }
예제 #2
0
        private void Reset()
        {
            reaction = MTools.GetInstance <ModeReaction>("Damaged");
            stats    = this.FindComponent <Stats>();
            Root     = transform.root.GetComponent <MDamageable>(); //Check if there's a Damageable on the Root
            if (Root == this)
            {
                Root = null;
            }

            if (stats == null)
            {
                stats = gameObject.AddComponent <Stats>();

                var health = MTools.GetInstance <StatID>("Health");

                if (health != null)
                {
                    stats.stats = new System.Collections.Generic.List <Stat>();
                    var HealthStat = new Stat()
                    {
                        ID       = health,
                        MaxValue = 100,
                        MinValue = 0,
                        value    = new FloatReference(100)
                    };
                    stats.stats.Add(HealthStat);
                }
            }
        }
예제 #3
0
 private void Reset()
 {
     reaction = MTools.GetInstance <ModeReaction>("Damaged");
     stats    = this.FindComponent <Stats>();
     Root     = transform.root.GetComponent <MDamageable>(); //Check if there's a Damageable on the Root
     if (Root == this)
     {
         Root = null;
     }
 }
예제 #4
0
        void Reset()
        {
            ModeID modeID = MTools.GetInstance <ModeID>("Attack1");

            animal = GetComponent <MAnimal>();

            if (modeID != null)
            {
                this.ModeID = modeID;
            }
        }