public void Start() { if (photonView.IsMine) { AbstractTank a = gameObject.GetComponent <AbstractTank>(); a.enabled = true; a.tag = "GameController"; } }
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); } }