|
|
|
|
|
|
abstract class MaterialStateProperty<T> : IMaterialStateProperty<T> { |
|
|
|
public abstract T resolve(HashSet<MaterialState> states); |
|
|
|
|
|
|
|
public static T resolveAs<T>(T value, HashSet<MaterialState> states) { |
|
|
|
if (value is MaterialStateProperty<T> materialStateProperty) { |
|
|
|
MaterialStateProperty<T> property = materialStateProperty; |
|
|
|
public static S resolveAs<S>(S value, HashSet<MaterialState> states) { |
|
|
|
if (value is MaterialStateProperty<S> materialStateProperty) { |
|
|
|
MaterialStateProperty<S> property = materialStateProperty; |
|
|
|
return property.resolve(states); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public static MaterialStateProperty<T> resolveWith<T>(material_.MaterialPropertyResolver<T> callback) => |
|
|
|
new _MaterialStateProperty<T>(callback); |
|
|
|
public static MaterialStateProperty<S> resolveWith<S>(material_.MaterialPropertyResolver<S> callback) => |
|
|
|
new _MaterialStateProperty<S>(callback); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override T resolve(HashSet<MaterialState> states) => _resolve(states); |
|
|
|
|
|
|
|
public static T resolveAs<T>(T value, HashSet<MaterialState> states) { |
|
|
|
if (value is MaterialStateProperty<T> materialStateProperty) { |
|
|
|
MaterialStateProperty<T> property = materialStateProperty; |
|
|
|
public static S resolveAs<S>(S value, HashSet<MaterialState> states) { |
|
|
|
if (value is MaterialStateProperty<S> materialStateProperty) { |
|
|
|
MaterialStateProperty<S> property = materialStateProperty; |
|
|
|
return property.resolve(states); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public static MaterialStateProperty<T> resolveWith<T>(material_.MaterialPropertyResolver<T> callback) => |
|
|
|
new _MaterialStateProperty<T>(callback); |
|
|
|
public static MaterialStateProperty<S> resolveWith<S>(material_.MaterialPropertyResolver<S> callback) => |
|
|
|
new _MaterialStateProperty<S>(callback); |
|
|
|
} |
|
|
|
} |