//When the player enters the temple they're trapped in the arena public void TrapPlayer() { BarrierOne.GetComponent <BoxCollider2D>().isTrigger = false; BarrierTwo.GetComponent <BoxCollider2D>().isTrigger = false; BarrierOne.GetComponent <SpriteRenderer>().enabled = true; BarrierTwo.GetComponent <SpriteRenderer>().enabled = true; }
//When triggered, the boxes will disable and the player can leave. public void FreePlayer() { if (isMonkey) { BarrierOne.SetActive(false); BarrierTwo.SetActive(false); } }
//When the activation animation happens, the player will be trapped into a box and forced to fight the enemy. public void TrapPlayer() { if (isMonkey) { BarrierTwo.GetComponent <BoxCollider2D>().isTrigger = false; } else { BarrierOne.GetComponent <BoxCollider2D>().isTrigger = false; BarrierTwo.GetComponent <BoxCollider2D>().isTrigger = false; } }
//When triggered, the box will disable and the player can leave. public void FreePlayer() { BarrierTwo.SetActive(false); }