Open OtakuAndFitness opened 2 years ago
Add this class somewhere in you codes.
public static class SerializedPropertyExtensions
{
public static Vector2 GetFloat2AsVector(this SerializedProperty property)
{
Vector2 output;
var p = property.Copy();
p.Next(true);
output.x = p.floatValue;
p.Next(true);
output.y = p.floatValue;
return output;
}
public static void SetFloat2FromVector(this SerializedProperty property, Vector2 value)
{
var p = property.Copy();
p.Next(true);
p.floatValue = value.x;
p.Next(true);
p.floatValue = value.y;
}
}
And then replace Vector2Field
property with function from the class.
Although there is another problem with Omnidirectional wave too try not to choose that type for waves.
In WaterSurfaceDataEditor.cs,the code
waveOrig.vector2Value = EditorGUI.Vector2Field(dirRect, "Point of Origin", waveOrig.vector2Value);
shows error if I call it.And even I comment it, there is nothing showing on the board if I click Customized button, Any help?