Example #1
0
 public override void AddDefault(Prop prop)
 {
     base.AddDefault(prop);
     prop.Add(PropertiesKey.MOTION_DELAY_TIME, "0");
     prop.Add(PropertiesKey.MOTION_P2P_SPEED, "1");
     prop.Add(PropertiesKey.MOTION_P2P_TARGET_NODE, "VALUE_NULL");
 }
Example #2
0
    public virtual void InitSqlite()
    {
        using (SqliteDataReader reader = LocalDB.instance.ExecuteReader("select * from " + m_FileName))
        {
            while (true)
            {
                if (!reader.Read())
                {
                    break;
                }

                Prop prop = new Prop();
                for (int i = 0; i < reader.FieldCount; i++)
                {
                    if (reader.GetName(i).Equals(PropertiesKey.MOTION_PROP))
                    {
                        prop.Add(reader.GetValue(i).ToString().Split(';'));
                    }
                    else
                    {
                        prop.Add(reader.GetName(i), reader.GetValue(i).ToString());
                    }
                }

                db.Add(prop);
            }
        }
    }
Example #3
0
 public dynamic this[string name]
 {
     get
     {
         if (Prop.ContainsKey(name))
         {
             return(Prop[name]);
         }
         else
         {
             return(null);
         }
     }
     set
     {
         if (Prop.ContainsKey(name))
         {
             Prop[name] = value;
         }
         else
         {
             Prop.Add(name, value);
         }
     }
 }
Example #4
0
 public override void AddDefault(Prop prop)
 {
     base.AddDefault(prop);
     for (int i = 0; i < SkillDefaultValue.MOTION_DEFAULT_VALUE_DIRECTLYTRIGGER.Length; i++)
     {
         prop.Add(SkillDefaultValue.MOTION_DEFAULT_VALUE_DIRECTLYTRIGGER[i].key, SkillDefaultValue.MOTION_DEFAULT_VALUE_DIRECTLYTRIGGER[i].default_value);
     }
 }
Example #5
0
 public override void AddDefault(Prop prop)
 {
     base.AddDefault(prop);
     for (int i = 0; i < SkillDefaultValue.ACTION_DEFAULT_VALUE_HP.Length; i++)
     {
         prop.Add(SkillDefaultValue.ACTION_DEFAULT_VALUE_HP[i].key, SkillDefaultValue.ACTION_DEFAULT_VALUE_HP[i].default_value);
     }
 }
Example #6
0
        /// <summary>
        /// 添加默认属性
        /// </summary>
        /// <param name="prop"></param>
        public virtual void AddDefault(Prop prop)
        {
            for (int i = 0; i < SkillDefaultValue.MOTION_DEFAULT_VALUE.Length; i++)
            {
                prop.Add(SkillDefaultValue.MOTION_DEFAULT_VALUE[i].key, SkillDefaultValue.MOTION_DEFAULT_VALUE[i].default_value);
            }

            prop.SetValue(PropertiesKey.MOTION_TYPE, this.ToString().Replace("Code.SkillSystem.Runtime.", ""));

            Init_Editor();
        }
Example #7
0
    public object ConvertToValue(object dbValue, System.Type valueType)
    {
        Prop   prop = new Prop();
        string str  = dbValue.ToStringOrEmpty();

        if (string.IsNullOrEmpty(str))
        {
            return(prop);
        }

        prop.Add(Prop.ConvertToStringArray(str));

        return(prop);
    }
Example #8
0
        public void AddDefault(Prop prop)
        {
            for (int i = 0; i < SkillDefaultValue.SUMMON_DEFAULT_VALUR.Length; i++)
            {
                prop.Add(SkillDefaultValue.SUMMON_DEFAULT_VALUR[i].key, SkillDefaultValue.SUMMON_DEFAULT_VALUR[i].default_value);

                Assembly assembly = Assembly.GetExecutingAssembly(); // 获取当前程序集

                DrawStyle drawstyle = assembly.CreateInstance(SkillDefaultValue.SUMMON_DEFAULT_VALUR[i].drawstyle_type.ToString().Replace("DS", "DrawStyle"), true, BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, new object[] { SkillDefaultValue.SUMMON_DEFAULT_VALUR[i].key }, null, null) as DrawStyle;
                drawstyle.SetDefaultValue(SkillDefaultValue.SUMMON_DEFAULT_VALUR[i].drawstyle_external_value);
                drawstyle.enable = SkillDefaultValue.SUMMON_DEFAULT_VALUR[i].drawstyle_enable;

                prop.AddStyle(drawstyle);
            }
        }
Example #9
0
    void OnGUI()
    {
        GUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("name:", GUILayout.Width(40));
        m_Prop_Name = EditorGUILayout.TextArea(m_Prop_Name);

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("value:", GUILayout.Width(48));
        m_Prop_Value = EditorGUILayout.TextArea(m_Prop_Value);
        GUILayout.EndHorizontal();

        if (GUILayout.Button("添加"))
        {
            if (string.IsNullOrEmpty(m_Prop_Name))
            {
                EditorUtility.DisplayDialog("注意", "属性名为空,请填写属性名!!!", "确定");
                return;
            }
            if (string.IsNullOrEmpty(m_Prop_Value))
            {
                EditorUtility.DisplayDialog("注意", "值为空,请填写值!!!", "确定");
                return;
            }
            if (m_Prop != null)
            {
                if (!m_Prop.HasValue(m_Prop_Name))
                {
                    m_Prop.Add(m_Prop_Name, m_Prop_Value);
                    if (EditorUtility.DisplayDialog("注意", "添加成功", "确定"))
                    {
                        Close();
                    }
                }
                else
                {
                    EditorUtility.DisplayDialog("注意", "已包含该名字!!!!", "确定");
                }
            }
        }
    }
Example #10
0
 public void Convert(string str)
 {
     prop.Add(Prop.ConvertToStringArray(str));
 }
Example #11
0
        public override void Draw()
        {
            base.Draw();
            GUILayout.BeginVertical("box");

            //技能基本数据
            if (m_IsDraw)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Space(20);
                EditorGUILayout.LabelField("summon_id:", GUILayout.Width(200));
                summon_id = EditorGUILayout.IntField(summon_id);

                if (GUILayout.Button("编辑"))
                {
                    SkillProp.right_draw = SkillProp.DrawSkillType.Summon;
                    if (SkillProp.CreateSummon != null)
                    {
                        TimeLine <Skill> line = (TimeLine <Skill>)holder;
                        SkillProp.CreateSummon(line.holder.skillStaticData.id, (uint)summon_id);
                    }
                }

                GUILayout.EndHorizontal();

                GUILayout.BeginVertical("box");

                if (sm_target_prop == null)
                {
                    GUILayout.BeginHorizontal();

                    d_sm_type = (eSMTarget)EditorGUILayout.EnumPopup(d_sm_type);

                    if (GUILayout.Button("添加"))
                    {
                        sm_target_prop = new Prop();
                        sm_target_prop.Add(PropertiesKey.TIMELINE_SUMMON_TARGET, d_sm_type.ToString());

                        //add default value
                        Assembly assembly = Assembly.GetExecutingAssembly(); // 获取当前程序集

                        Code.SkillSystem.Runtime.SMTargetGet sm_target = assembly.CreateInstance("Code.SkillSystem.Runtime." + sm_target_prop.GetString(PropertiesKey.TIMELINE_SUMMON_TARGET), true, BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, new object[] { ((Skill)holder.GetHolder()).holder }, null, null) as Code.SkillSystem.Runtime.SMTargetGet;

                        sm_target.AddDefault(sm_target_prop);
                    }
                    GUILayout.EndHorizontal();
                }
                else
                {
                    sm_target_prop.Draw("飞行物飞行目标");

                    GUILayout.BeginHorizontal();
                    d_sm_type = (eSMTarget)EditorGUILayout.EnumPopup(d_sm_type);

                    if (GUILayout.Button("更换"))
                    {
                        sm_target_prop = new Prop();
                        sm_target_prop.Add(PropertiesKey.TIMELINE_SUMMON_TARGET, d_sm_type.ToString());

                        //add default value
                        Assembly assembly = Assembly.GetExecutingAssembly(); // 获取当前程序集

                        Code.SkillSystem.Runtime.SMTargetGet sm_target = assembly.CreateInstance("Code.SkillSystem.Runtime." + sm_target_prop.GetString(PropertiesKey.TIMELINE_SUMMON_TARGET), true, BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, new object[] { ((Skill)holder.GetHolder()).holder }, null, null) as Code.SkillSystem.Runtime.SMTargetGet;

                        sm_target.AddDefault(sm_target_prop);
                    }
                    GUILayout.EndHorizontal();
                }

                GUILayout.EndVertical();
            }

            GUILayout.EndVertical();
        }
Example #12
0
 public virtual void AddDefault(Prop prop)
 {
     prop.Add(PropertiesKey.ACTION_TYPE, this.ToString().Replace("Code.SkillSystem.Runtime.", ""));
 }