void Start()
    {
        // set up subject for observer
        subject = new Subject(this);

        // register observers
        var animOb = new AnimObserver();
        var audioOb = new AudioObserver();

        subject.AddObserver(animOb);
        subject.AddObserver(audioOb);

        // init command
        moveByXCommand = new MoveByXCommand();
        /*
        MoveByCommand command = new MoveByCommand(0.5f, 0);
        command.AddCommandExecutedCallback(CommandFinishCallback);
        command.execute(this);
        */

        //body2d.velocity = new Vector2(5, 0);
    }
Esempio n. 2
0
    void Start()
    {
        // set up subject for observer
        subject = new Subject(this);

        // register observers
        var animOb  = new AnimObserver();
        var audioOb = new AudioObserver();

        subject.AddObserver(animOb);
        subject.AddObserver(audioOb);

        // init command
        moveByXCommand = new MoveByXCommand();

        /*
         * MoveByCommand command = new MoveByCommand(0.5f, 0);
         * command.AddCommandExecutedCallback(CommandFinishCallback);
         * command.execute(this);
         */

        //body2d.velocity = new Vector2(5, 0);
    }