Example #1
0
 public void OnEvent(GameEvent gameEvent)
 {
     if (gameEvent.GetType() == typeof(PointEvent))
     {
         if (gameEvent.number == ServiceLocator.Instance.gameConfig.headShotPoint)
         {
             ServiceLocator.Instance.eventManager.Propagate(new NotifEvent("HeadShot"));
             playerModel.AddHeadShot();
             if (playerModel.getHeadShot() == 5)
             {
                 playerModel.setLife(playerConfig.maxLife);
                 playerModel.ResetHeadShot();
             }
         }
         playerModel.AddPoint(gameEvent.number);
         Debug.Log("POINTS : " + playerModel.GetPoint().ToString());
     }
 }