コード例 #1
0
ファイル: PlayerManager.cs プロジェクト: squidarth/Assassins
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "LootBox" && lootBoxInRange != null)
     {
         Debug.Log("Leaving range of loot box");
         lootBoxInRange.CloseBox();
         lootBoxInRange = null;
     }
 }
コード例 #2
0
ファイル: PlayerManager.cs プロジェクト: squidarth/Assassins
 private void OnTriggerEnter2D(Collider2D collision)
 {
     Debug.Log("Entered a trigger range");
     if (collision.gameObject.tag == "LootBox" && (this.gameObject == PlayerManager.LocalPlayerInstance || !PhotonNetwork.IsConnected))
     {
         lootBoxInRange = collision.gameObject.GetComponent <LootBox>();
         Debug.LogFormat("setting lootBoxInragne to {0}", lootBoxInRange);
     }
 }