Beispiel #1
0
 public void notify( IIwEvent evt )
 {
     if ( evt.name == PlayerWire.PLAYER_LIVES_CHANGED )
     {
         PlayerWire playerData = IwGameDemo.Instance.getWire ( PlayerWire.NAME ) as PlayerWire;
         _livesToShow = playerData.lives;
     }
 }
 public void execute( IIwEvent evt )
 {
     PlayerWire player = IwGameDemo.Instance.getWire (PlayerWire.NAME) as PlayerWire;
     if ( player != null )
     {
         player.lives--;
     }
 }
Beispiel #3
0
        public void executeCommands( IIwEvent evt )
        {
            if ( hasEvent ( evt.name ) )
            {
                List <Type> tmpCommandsByEventName = _commandList[evt.name];

                foreach ( Type tmpCommandClass in tmpCommandsByEventName )
                {
                    IIwCommand tmpCommand = Activator.CreateInstance ( tmpCommandClass ) as IIwCommand;
                    tmpCommand.dispatcher = _dispatcher;
                    tmpCommand.execute ( evt );
                }
            }
        }
Beispiel #4
0
 public void notify( IIwEvent evt )
 {
     if ( evt.name == IwPlayerView.PLAYER_WRONG )
     {
         renderer.material.color = Color.red;
         _inAttack = true;
         // here you can write your code for attack
     }
     else if ( evt.name == IwPlayerView.PLAYER_IS_SAFE )
     {
         renderer.material.color = Color.green;
         _inAttack = false;
         // here you can write your code for idle
     }
 }
Beispiel #5
0
        public void notifyViews( IIwEvent evt )
        {
            if ( !hasViewsByEvent ( evt.name ) )
                return;

            List<IIwView> tmpViewsToNotify = _viewsForNotify [evt.name];
            foreach ( IIwView tmpView in tmpViewsToNotify )
            {
                tmpView.notify ( evt );
            }
        }
Beispiel #6
0
 private void HandleOnTriggerEvent(IIwEvent evt)
 {
     _controller.executeCommands (evt);
     _viewsMgr.notifyViews (evt);
 }
Beispiel #7
0
 public void notify( IIwEvent evt )
 {
 }