Skip to main content

Adding functionality to classes while adhering to their anatomy

When extending the functionality of C# scripts, our added code needs to comply with the basic anatomy, syntax, and naming conventions.

 

When we create Instances of Prefabs at a spawn location, we want to destroy them at some point trough mechanisms like a 'lifetime' property.

One way to do this is adding some functionality to our Random Walker class.

Open the Random Walker Script and after the Class Declaration add