Do you want to improve this question?Edit your post to clarify the issue you are trying to resolve by adding details.
Closed 6 years ago.
6 years agoFor example,
To sampleclass
public static int sample
sample=10;
Let's say that
Put this in the sample2 class
Is there a way to put the sample as static? This is c#
c# unity3d
Properties allow you to access sampleclass.sample
directly within sample2
.
class sample 2
{
private static int sample
{
get
{
return sampleclass.sample;
}
set
{
sampleclass.sample=value;
}
}
}
However, it is not a true field and cannot be used as a reference.
In addition, C#6.0, using static sampleclass
omits sampleclass
to call the method.
© 2024 OneMinuteCode. All rights reserved.