mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-12-03 14:57:29 +00:00
further work
attempt at fixing colour deserialization, not working
This commit is contained in:
parent
f209b2fd17
commit
cc577966c1
7 changed files with 17 additions and 17 deletions
|
@ -198,14 +198,14 @@ namespace HeavenStudio
|
|||
{ "type5", entity.type5 },
|
||||
{ "type6", entity.type6 },
|
||||
|
||||
{ "ease", entity.ease },
|
||||
{ "ease", (int) entity.ease },
|
||||
|
||||
{ "colorA", entity.colorA },
|
||||
{ "colorB", entity.colorB },
|
||||
{ "colorC", entity.colorC },
|
||||
{ "colorD", entity.colorD },
|
||||
{ "colorE", entity.colorE },
|
||||
{ "colorF", entity.colorF },
|
||||
{ "colorA", (EntityTypes.SerializableColor) entity.colorA },
|
||||
{ "colorB", (EntityTypes.SerializableColor) entity.colorB },
|
||||
{ "colorC", (EntityTypes.SerializableColor) entity.colorC },
|
||||
{ "colorD", (EntityTypes.SerializableColor) entity.colorD },
|
||||
{ "colorE", (EntityTypes.SerializableColor) entity.colorE },
|
||||
{ "colorF", (EntityTypes.SerializableColor) entity.colorF },
|
||||
|
||||
{ "text1", entity.text1 },
|
||||
{ "text2", entity.text2 },
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace HeavenStudio
|
|||
float prog = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
|
||||
if (prog >= 0f)
|
||||
{
|
||||
EasingFunction.Function func = EasingFunction.GetEasingFunction(e["ease"]);
|
||||
EasingFunction.Function func = EasingFunction.GetEasingFunction((EasingFunction.Ease) e["ease"]);
|
||||
float dx = func(positionLast.x, e["valA"], Mathf.Min(prog, 1f));
|
||||
float dy = func(positionLast.y, e["valB"], Mathf.Min(prog, 1f));
|
||||
float dz = func(positionLast.z, -e["valC"], Mathf.Min(prog, 1f));
|
||||
|
@ -145,7 +145,7 @@ namespace HeavenStudio
|
|||
float prog = Conductor.instance.GetPositionFromBeat(e.beat, e.length);
|
||||
if (prog >= 0f)
|
||||
{
|
||||
EasingFunction.Function func = EasingFunction.GetEasingFunction(e["ease"]);
|
||||
EasingFunction.Function func = EasingFunction.GetEasingFunction((EasingFunction.Ease) e["ease"]);
|
||||
float dx = func(rotEluerLast.x, e["valA"], Mathf.Min(prog, 1f));
|
||||
float dy = func(rotEluerLast.y, e["valB"], Mathf.Min(prog, 1f));
|
||||
float dz = func(-rotEluerLast.z, e["valC"], Mathf.Min(prog, 1f));
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace HeavenStudio.Games.Global
|
|||
endCol = new Color(colB.r, colB.g, colB.b, startEntity["valB"]);
|
||||
}
|
||||
|
||||
SetFade(startEntity.beat, startEntity.length, startCol, endCol, startEntity["ease"]);
|
||||
SetFade(startEntity.beat, startEntity.length, startCol, endCol, (EasingFunction.Ease) startEntity["ease"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ namespace HeavenStudio.Games
|
|||
else
|
||||
currentZoomCamDistance = dist;
|
||||
|
||||
lastEase = allCameraEvents[currentZoomIndex]["ease"];
|
||||
lastEase = (EasingFunction.Ease) allCameraEvents[currentZoomIndex]["ease"];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -120,10 +120,10 @@ namespace HeavenStudio.Editor
|
|||
);
|
||||
break;
|
||||
|
||||
case Color _:
|
||||
case EntityTypes.SerializableColor _:
|
||||
case Color _:
|
||||
colorPreview.colorPicker.onColorChanged += _ =>
|
||||
parameterManager.entity[propertyName] = colorPreview.colorPicker.color;
|
||||
parameterManager.entity[propertyName] = new EntityTypes.SerializableColor { Color = colorPreview.colorPicker.color };
|
||||
|
||||
Color paramCol = parameterManager.entity[propertyName];
|
||||
|
||||
|
|
|
@ -594,7 +594,7 @@ namespace HeavenStudio.Editor.Track
|
|||
}
|
||||
else if (propertyType == typeof(Color))
|
||||
{
|
||||
returnVal = new EntityTypes.SerializableColor{ Color = (Color)ep[i].parameter };
|
||||
returnVal = new EntityTypes.SerializableColor { Color = (UnityEngine.Color) ep[i].parameter };
|
||||
}
|
||||
else if (propertyType.IsEnum)
|
||||
{
|
||||
|
|
|
@ -43,20 +43,20 @@ namespace HeavenStudio
|
|||
public class SerializableColor
|
||||
{
|
||||
public float[] colorStore = new float[4] { 1F, 1F, 1F, 1F };
|
||||
public Color Color
|
||||
public UnityEngine.Color Color
|
||||
{
|
||||
get { return new Color(colorStore[0], colorStore[1], colorStore[2], colorStore[3]); }
|
||||
set { colorStore = new float[4] { value.r, value.g, value.b, value.a }; }
|
||||
}
|
||||
|
||||
//makes this class usable as Color, Color normalColor = mySerializableColor;
|
||||
public static implicit operator Color(SerializableColor instance)
|
||||
public static implicit operator UnityEngine.Color(SerializableColor instance)
|
||||
{
|
||||
return instance.Color;
|
||||
}
|
||||
|
||||
//makes this class assignable by Color, SerializableColor myColor = Color.white;
|
||||
public static implicit operator SerializableColor(Color color)
|
||||
public static implicit operator SerializableColor(UnityEngine.Color color)
|
||||
{
|
||||
return new SerializableColor { Color = color };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue