Answer the question
In order to leave comments, you need to log in
Individual value for each object when inheriting?
The script inherits variables (let's say B and C). The value B is common for all objects, and C is individual for each object on which the script hangs. How to describe C so that each object is assigned a different meaning , depending on the circumstances accompanying it personally?
Answer the question
In order to leave comments, you need to log in
Something like this
class A
{
public virtual int C
{
get => 12;
}
}
class B : A
{
public override int C
{
get => 11;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question