コード例 #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Q))
     {
         fulltimeWorker.CalculateMonthlySalary();
     }
     else if (Input.GetKeyDown(KeyCode.W))
     {
         parttimeWorker.CalculateMonthlySalary();
     }
 }
コード例 #2
0
    // Start is called before the first frame update
    void Start()
    {
        andrea.name    = "Andrea";
        andrea.company = "Goldsmiths";
        andrea.salary  = 500;
        andrea.CalculateMonthlySalary();

        nima.name         = "Nima";
        nima.company      = "Goldsmiths";
        nima.hourseWorked = 20;
        nima.hourlyRate   = 21;
        nima.CalculateMonthlySalary();
    }