Esempio n. 1
0
 public void Start()
 {
     if (photonView.IsMine)
     {
         AbstractTank a = gameObject.GetComponent <AbstractTank>();
         a.enabled = true;
         a.tag     = "GameController";
     }
 }
Esempio n. 2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player" || collision.tag == "Bullet")
        {
            if (collision.tag == "Player")
            {
                AbstractTank abstractTank = collision.gameObject.GetComponent <AbstractTank>();

                //PhotonView pView = abstractTank.GetComponent<PhotonView>();
                //pView.RPC("CollectHealth", RpcTarget.All);
                abstractTank.CollectHealth();
            }
            Destroy(gameObject, 0.05f);
        }
    }