Created
November 23, 2021 06:29
-
-
Save GT3000/f78763375d25e9963443979ac2fe5297 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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
//Derives from Gold Distribution | |
public class Mercenary : GoldDistribution | |
{ | |
[SerializeField] private int contractLength = 1; | |
[SerializeField] private int contractRate = 10000; | |
//Overrides the base class of Gold Distribution's CalculateUnitSalary to say how much this unit gets paid | |
public override void CalculateUnitSalary() | |
{ | |
Debug.Log("Payroll: " + (contractLength * contractRate)); | |
Debug.Log("Contract Length: " + contractLength); | |
} | |
//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