Created
November 23, 2021 06:30
-
-
Save GT3000/128af41f3a9966b62c7631fb9d148f9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
//Derives from Gold Distribution | |
public class Soldier : GoldDistribution | |
{ | |
[SerializeField] private int unitSalary = 5000; | |
//Overrides the base class of Gold Distribution's CalculateUnitSalary to say how much this unit gets paid | |
public override void CalculateUnitSalary() | |
{ | |
Debug.Log("Payroll: " + unitSalary); | |
} | |
//Calls UnitIdentification in the base GoldDistribution class and the runs the overrides CalculateUnit Salary from GoldDistribution | |
private void Start() | |
{ | |
UnitIdentification(); | |
CalculateUnitSalary(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment