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); } }
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); } }
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)); }