PlayerController Mods

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

Optional: You can add Audio source, clips, logic that can be played when colliding with Pickup with correct audioSource. ( Collectible, Water )

Contains custom Events, LevelManager is the subscriber object:

  • onPlayerReachExit

  • onPlayerDied

updated 4/19/2020 - Added switch-case logic for OnTriggerEnter( )

Last updated

Was this helpful?