Пример #1
0
    // Use this for initialization
    void Start()
    {
        commandStream = new CommandStream();
        commandRecord = new Dictionary <ObjectBase, List <CommandStream> > ();


        CommandConversion Do_FrieCommand = (ObjectBase playObj) => {
            FrieCommand frie = new FrieCommand();
            frie.Execute(playObj);
            commandRecord [playObj].Add(frie);
        };

        CommandConversion Do_EludeCommand = (ObjectBase playObj) => {
            EludeCommand elude = new EludeCommand();
            elude.Execute(playObj);
            commandRecord [playObj].Add(elude);
        };

        CommandConversion Do_JumpCommand = (ObjectBase playObj) => {
            JumpCommand jump = new JumpCommand();
            jump.Execute(playObj);
            commandRecord [playObj].Add(jump);
        };

        CommandConversion Do_SupplementCommand = (ObjectBase playObj) => {
            SupplementCommand supplement = new SupplementCommand();
            supplement.Execute(playObj);
            commandRecord [playObj].Add(supplement);
        };

        CommandConversion Do_WalkCommand = (ObjectBase playObj) => {
            WalkCommand walk = new WalkCommand();
            walk.Execute(playObj);
            commandRecord [playObj].Add(walk);
        };

        CommandRoute.Add(CommandType.EludeCommand, Do_EludeCommand);
        CommandRoute.Add(CommandType.FrieCommand, Do_FrieCommand);
        CommandRoute.Add(CommandType.JumpCommand, Do_JumpCommand);
        CommandRoute.Add(CommandType.SupplementCommand, Do_SupplementCommand);
        CommandRoute.Add(CommandType.WalkCommand, Do_WalkCommand);
    }
 public virtual void Frie(FrieCommand command)
 {
     Debug.Log("开火...");
 }