public override void OnInspectorGUI() { base.OnInspectorGUI(); if (Instance == null) { return; } if (GUILayout.Button("Auto Generate")) { MotionMachine machine = Instance.GetMotionMachine(); if (machine == null || machine.Motions == null || machine.Motions.Count == 0) { return; } if (Instance.Commands == null) { Instance.Commands = new List <MotionCommander.Command>(); } List <Motion> motions = machine.Motions; for (int i = 0; i < motions.Count; i++) { Motion motion = motions[i]; if (motion == null) { continue; } string[] strArray = motion.Type.ToString().Split(new char[] { '_' }); if (strArray == null || strArray.Length < 2) { continue; } string tempStr = strArray[1]; if (tempStr.StartsWith("Pre") || tempStr.EndsWith("End")) { continue; } CharacterCommand commandType = Utility.RMT_CC(motion.Type); MotionCommander.Command command = Instance.TryGet(commandType); if (command == null) { command = new MotionCommander.Command(); command.Type = commandType; command.DisplayName = commandType.ToString(); command.SequentialMotions.Add(motion.Type); Instance.Add(command); } } } }
void JumpEnd(MotionCommander.Command cmd, Motion motion) { cmd.OnFinishDelegate -= JumpEnd; //Character.pTargetPos += new Vector3(0, 0, 3); //Character.ExecuteCommand(CharacterCommand.CC_WalkToPoint); }
void RunEnd(MotionCommander.Command cmd, Motion motion) { cmd.OnFinishDelegate -= RunEnd; //Debug.LogError("Run End"); }