예제 #1
0
        public static CharacterCommand RMT_CC(RoleMotionType type)
        {
            if (type == RoleMotionType.RMT_Idle)
            {
                return(CharacterCommand.CC_Stop);
            }
            else if (type == RoleMotionType.RMT_Run)
            {
                return(CharacterCommand.CC_WalkToPoint);
            }
            else if (type == RoleMotionType.RMT_Jump)
            {
                return(CharacterCommand.CC_JumpToPoint);
            }
            else if (type == RoleMotionType.RMT_Fly)
            {
                return(CharacterCommand.CC_FlyToPoint);
            }
            string[] strArray = type.ToString().Split(new char[] { '_' });
            if (strArray == null || strArray.Length < 2)
            {
                return(CharacterCommand.CC_Stop);
            }
            string rmtStr = "CC_" + strArray[1];

            try
            {
                CharacterCommand cc = (CharacterCommand)System.Enum.Parse(typeof(CharacterCommand), rmtStr);
                return(cc);
            }
            catch
            {
                return(CharacterCommand.CC_Stop);
            }
        }
예제 #2
0
        public static CharacterCommand GenerateCharacterCommandByRmt(RoleMotionType varType)
        {
            if (varType == RoleMotionType.RMT_Idle)
            {
                return(CharacterCommand.CC_Stop);
            }
            string[] strArray = varType.ToString().Split(new char[] { '_' });
            if (strArray == null || strArray.Length < 2)
            {
                return(CharacterCommand.CC_None);
            }
            string commandStr = "CC_" + strArray[1];

            try
            {
                CharacterCommand command = (CharacterCommand)System.Enum.Parse(typeof(CharacterCommand), commandStr);
                return(command);
            }
            catch
            {
                return(CharacterCommand.CC_None);
            }
        }
예제 #3
0
        public MotionPlugin GetSpecificPlugin(RoleMotionType type, string pluginName)
        {
            Motion motion = GetMotion(type);

            if (motion == null)
            {
                Utility.LogError("GetSpecificPlugin error caused by null motion named: " + type.ToString());
                return(null);
            }
            return(motion.GetPlugin(pluginName));
        }