Programming Unity C# //

FYI: Most of my coding structure is based off object systems (EX: Character System, Enemy System, Item System.) Each script would categorize in its own section in the game and methods would be called from each one if one of them in the game would interact. Each system script can contain from 800 to 6365 lines of code.

Interface & Inheritance //

ISwordHittable Interface is called from sword system and enemy system

When sword object collides with an object inherited with ISwordHittable

Message "OnGetHitBySword" is called to enemy system On Trigger with sword causing damage 

Enemy system inheritance 

Singletons/Static variables //

Static variable booleans in character controller  

Static variables are used to cease movement players camera if any one static bool is true.

Loops(whiles, For & Foreach) //

Foreach being used to set active an array of game objects

While loops to create pulsing sprites or text in the UI

For loop adding an array of Unity event button listeners to my shop system

Enum & Switch //

Switch statement using enum to select Item for Shop System

Serializeable Structs //

Serializing a public struct enables a menu in unity inspector for accessing sprites directly

Unity Events and Actions + Delegate //

Assign the unity event handler to an array of buttons, adding listeners that run a delegate 

Assigning a unity action variable to the add listener for purchasing Items

System Collections IEnumerator and Coroutine //

IEnumerator fade image method for black screen transitioning

Instantiation //

Enemy territory activator instantiates enemies in a section when player enters a trigger

© 2019 Michael Wills / N163LPH03N1X Games