public float HealingCooltime = 1f;  //healer
    public dynamic refer(int space, MLAgents.ResetParameters param)
    {
        dynamic obj = new ExpandoObject();

        if (AgentType == "Unit")
        {
            obj.Param = param;
            return(obj);
        }
        AgnetBrain.brainParameters.vectorObservationSize = space;
        obj.AgnetBrain            = AgnetBrain;
        obj.AgentType             = AgentType;
        obj.lives                 = lives;
        obj.damage                = damage;
        obj.attackTag             = attackTag;
        obj.ragdoll               = ragdoll;
        obj.Hitbox                = Hitbox;
        obj.attackAudio           = attackAudio;
        obj.runAudio              = runAudio;
        obj.maxStopSeconds        = maxStopSeconds;
        obj.VectorMagnitude       = VectorMagnitude;
        obj.DeprecatedAttackRange = DeprecatedAttackRange;
        obj.DamagedParticle       = DamagedParticle;
        obj.HealedParticle        = HealedParticle;
        obj.HealingParticle       = HealingParticle;
        obj.AttackCooltime        = AttackCooltime;
        obj.HealingCooltime       = HealingCooltime;
        obj.Param                 = param;
        return(obj);
    }
Esempio n. 2
0
    public void initRefer(dynamic obj)
    {
        param = obj.Param;
        float plive, pcool, pdamage;

        lives          = (param.TryGetValue("EnemyHP", out plive))?plive:lives;
        damage         = (param.TryGetValue("EnemyDamage", out pdamage))?pdamage:damage;
        AttackCooltime = (param.TryGetValue("EnemyAttackCooltime", out pcool))?pcool:AttackCooltime;
    }
Esempio n. 3
0
 private void CheckInitialize(SerializedProperty property, GUIContent label)
 {
     if (_Dictionary == null)
     {
         var target = property.serializedObject.targetObject;
         _Dictionary = fieldInfo.GetValue(target) as ResetParameters;
         if (_Dictionary == null)
         {
             _Dictionary = new ResetParameters();
             fieldInfo.SetValue(target, _Dictionary);
         }
     }
 }
        /// <summary>
        /// Ensures that the state of the Drawer is synchronized with the property.
        /// </summary>
        /// <param name="property">The SerializedProperty of the ResetParameters
        /// to make the custom GUI for.</param>
        private void LazyInitializeParameters(SerializedProperty property)
        {
            if (m_Parameters != null)
            {
                return;
            }
            var target = property.serializedObject.targetObject;

            m_Parameters = fieldInfo.GetValue(target) as ResetParameters;
            if (m_Parameters == null)
            {
                m_Parameters = new ResetParameters();
                fieldInfo.SetValue(target, m_Parameters);
            }
        }
        /// <summary>
        /// Ensures that the state of the Drawer is synchronized with the property.
        /// </summary>
        /// <param name="property">The SerializedProperty of the ResetParameters
        /// to make the custom GUI for.</param>
        /// <param name="label">The label of this property.</param>
        private void LazyInitializeParameters(SerializedProperty property, GUIContent label)
        {
            if (_parameters != null)
            {
                return;
            }
            var target = property.serializedObject.targetObject;

            _parameters = fieldInfo.GetValue(target) as ResetParameters;
            if (_parameters == null)
            {
                _parameters = new ResetParameters();
                fieldInfo.SetValue(target, _parameters);
            }
        }