I wrote a property class like this
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class property2 : property {
// Start is called before the first frame update
void Start()
{
}
// // Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.DownArrow))
{
print(getsalary());
}
}
}
We created a property2 class to inherit the property.
Question) When the salary value changes within the property class by pressing UpArrow, the code was created with the intention of changing the salary value output from the property2 class, but the salary value output from the property2 class does not change. How do I solve this?
If you don't understand the question, please leave a comment I'll try harder to explain ㅠ<
c#
If you use Update in a child class, Update in the parent class is not invoked automatically. I think you should call base.Update from your child's Update.
© 2024 OneMinuteCode. All rights reserved.