PlayerController_v2 Mods

Important: This code is to be used with the Simplified MiniGame. In LevelManager, the script component of type: PlayerController is used, you must make a change to LevelManager, so it uses PlayerController_v2, or change the name of this file, and class to PlayerController.cs

Includes Updates for: InventorySystem, LevelManager.

OnTriggerEnter2D contains code to test for collisions with GameObjects with Collider2D set as 'Trigger' based on several different gameObject tags Tags used in PlayerController :

  • Collectible

    • Requires either PickUp.cs or ScorePickUp.cs

    • PickUp.cs requires ItemInstance - ScriptableObject - adds value to Score, adds ItemInstance to Inventory

    • ScorePickUp.cs - adds value to score

  • Hazard

    • Requires either PickUp.cs or Hazard.cs

  • Water

    • Invokes: onPlayerDied

  • Exit

    • Invokes: onReachedExit

Audio clips played if colliding with Pickup with correct audioSource. ( Collectible, Water )

Audio Clips:

Contains custom Events, LevelManager is the subscriber object:

  • onPlayerReachedExit

  • onPlayerDied

Updated Apr 22, 2019

Last updated

Was this helpful?