示例#1
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);
                }
            }
        }
示例#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;
     }
 }
示例#3
0
        private void OnEnable()
        {
            M = (MDamageable)target;

            reaction   = serializedObject.FindProperty("reaction");
            stats      = serializedObject.FindProperty("stats");
            multiplier = serializedObject.FindProperty("multiplier");
            events     = serializedObject.FindProperty("events");
            Root       = serializedObject.FindProperty("Root");
        }