Example #1
0
        public static SkillLogicState GetSkillLogicState(string name)
        {
            if (!SkillLogicStates.ContainsKey(name))
            {
                return(null);
            }
            SkillLogicState state = SkillLogicStates[name];

            return(state);
        }
Example #2
0
        public static SkillLogicState GetSkillLogicState(SkillInfo_New skillInfo, SkillObj logObj)
        {
            string          stateName = logObj.GetSkillLogicStateName(skillInfo);
            SkillLogicState state     = GetSkillLogicState(stateName);

            if (state == null && logObj != null)
            {
                logObj.LogInfo("SkillLogicStates not found stateName[{0}]".F(stateName));
            }
            return(state);
        }
Example #3
0
        private BattleInitClass()
        {
            var asm = Assembly.GetExecutingAssembly();

            foreach (var b in asm.GetTypes())
            {
                if (b.IsSubclassOf(typeof(SkillLogic)))
                {
                    //自动填充SkillLogics
                    SkillLogic ins = asm.CreateInstance(b.FullName) as SkillLogic;
                    BattleModule.SkillLogics.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(SkillLogicState)))
                {
                    //自动填充SkillLogicStates
                    SkillLogicState ins = asm.CreateInstance(b.FullName) as SkillLogicState;
                    BattleModule.SkillLogicStates.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(TargetSelect)))
                {
                    //自动填充TargetSelect
                    TargetSelect ins = asm.CreateInstance(b.FullName) as TargetSelect;
                    BattleModule.TargetSelects.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(TargetType)))
                {
                    //自动填充TargetType
                    TargetType ins = asm.CreateInstance(b.FullName) as TargetType;
                    BattleModule.TargetTypes.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(BuffLogicState)))
                {
                    //自动填充BuffLogicStates
                    BuffLogicState ins = asm.CreateInstance(b.FullName) as BuffLogicState;
                    BattleModule.BuffLogicStates.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(BuffLogic)))
                {
                    //自动填充BuffLogicStates
                    BuffLogic ins = asm.CreateInstance(b.FullName) as BuffLogic;
                    BattleModule.BuffLogics.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(BuffSuperpositionLogic)))
                {
                    //自动填充BuffSuperpositionLogics
                    BuffSuperpositionLogic ins = asm.CreateInstance(b.FullName) as BuffSuperpositionLogic;
                    BattleModule.BuffSuperpositionLogics.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(SkillBulletMovingLogic)))
                {
                    //自动填充SkillBulletMovingLogic
                    SkillBulletMovingLogic ins = asm.CreateInstance(b.FullName) as SkillBulletMovingLogic;
                    BattleModule.SkillBulletMovingLogics.Add(b.Name, ins);
                }
                else if (b.IsSubclassOf(typeof(SkillBulletCollisionLogic)))
                {
                    //自动填充SkillBulletCollisionLogic
                    SkillBulletCollisionLogic ins = asm.CreateInstance(b.FullName) as SkillBulletCollisionLogic;
                    BattleModule.SkillBulletCollisionLogics.Add(b.Name, ins);
                }
            }
        }