Dev Log 113: Using Class Inheritance To Create Bank & Credit Union Information

Kenny Pruitt
2 min readJun 13, 2023

--

For this example of class inheritance, I will make bank and credit union data. First to create this, I will create a class for the bank’s data which will also have all the functions that all banks will have, such as checking balance, withdrawing, and depositing.

Then I will create a few gameobjects in my scene that will represent the banks in my scene. I will create 3 banks, Bank of America, Chase, and Wells Fargo.

Now for each of these banks I will create a new script for the bank’s behavior which will use the banks data to define the banks.

Next I will create a new script that will define a Credit Union, which will have the same functions as a bank but the credit unions will be able to loan money as well.

Then I will create the credit unions in Unity and create a credit union behavior for them that will use the credit union data.

--

--

Kenny Pruitt

Unity Game Developer, C# Developer, and Software Engineer