Ejemplo n.º 1
0
 private void OnEventProcessAttack(BaseEventMsg msg)
 {
     if (debug)
     {
         Debug.Log("onEvent attack");
     }
     canAttack = true;
 }
 private void OnEventProcessSpawnMagic(BaseEventMsg msg)
 {
     if (debug)
     {
         Debug.Log("onEventProcessSpawnMagic");
     }
     if (msg != null && msg.paramObjects.Length > 0)
     {
         var player    = msg.paramObjects[0] as Player;
         var magicBall = GameObject.Instantiate(player.magicBall, player.shootPoint.position, player.shootPoint.rotation);
         //magicBall.GetComponent<MagicController>().velocity = magicBall.transform.forward * player.shootSpeed;
         //GameManager.Instance.AddSpawn(magicBall.GetComponent<MagicController>(), player.gameObject.GetComponent<PlayerEntity>());
         //player.gameObject.GetComponent<PlayerEntity>().CmdSpawnGameObject(magicBall);
     }
 }
 private void OnEventProcessHitAttack(BaseEventMsg msg)
 {
     if (debug)
     {
         Debug.Log("onEventProcess hit attack");
     }
     if (msg != null && msg.paramObjects.Length > 0)
     {
         uint    id       = (uint)msg.paramObjects[0];
         int     damage   = (int)msg.paramObjects[1];
         Vector3 hitPoint = (Vector3)msg.paramObjects[2];
         Player  player   = GameManager.Instance.GetFromId(id);
         player.gameObject.GetComponent <PlayerEntity>().health -= damage;
         player.graphicComponent.GetStab();
         EffectManager.Instance.ShowEffect("Player", hitPoint, Quaternion.identity);
     }
 }