Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public InteractableActivateTheme()
{
Types = new Type[] { typeof(Transform) };
Name = "Activate Theme";
NoEasing = true;
ThemeProperties.Add(
new InteractableThemeProperty()
{
Expand All @@ -24,13 +25,7 @@ public InteractableActivateTheme()
Default = new InteractableThemePropertyValue() { Bool = true }
});
}

public override void Init(GameObject host, InteractableThemePropertySettings settings)
{
base.Init(host, settings);

settings.NoEasing = true;
}


public override InteractableThemePropertyValue GetProperty(InteractableThemeProperty property)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public InteractableAudioTheme()
{
Types = new Type[] { typeof(Transform) };
Name = "Audio Theme";
NoEasing = true;
ThemeProperties.Add(
new InteractableThemeProperty()
{
Expand All @@ -25,13 +26,6 @@ public InteractableAudioTheme()
});
}

public override void Init(GameObject host, InteractableThemePropertySettings settings)
{
base.Init(host, settings);

settings.NoEasing = true;
}

public override InteractableThemePropertyValue GetProperty(InteractableThemeProperty property)
{
InteractableThemePropertyValue start = new InteractableThemePropertyValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public InteractableMaterialTheme()
{
Types = new Type[] { typeof(Renderer) };
Name = "Material Theme";
NoEasing = true;
ThemeProperties.Add(
new InteractableThemeProperty()
{
Expand All @@ -26,13 +27,6 @@ public InteractableMaterialTheme()
});
}

public override void Init(GameObject host, InteractableThemePropertySettings settings)
{
base.Init(host, settings);

settings.NoEasing = true;
}

public override InteractableThemePropertyValue GetProperty(InteractableThemeProperty property)
{
InteractableThemePropertyValue start = new InteractableThemePropertyValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public InteractableStringTheme()
{
Types = new Type[] { typeof(TextMesh), typeof(Text) };
Name = "String Theme";
NoEasing = true;
ThemeProperties.Add(
new InteractableThemeProperty()
{
Expand All @@ -29,12 +30,6 @@ public InteractableStringTheme()
});
}

public override void Init(GameObject host, InteractableThemePropertySettings settings)
{
base.Init(host, settings);
settings.NoEasing = true;
}

public override InteractableThemePropertyValue GetProperty(InteractableThemeProperty property)
{
InteractableThemePropertyValue start = new InteractableThemePropertyValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public InteractableTextureTheme()
{
Types = new Type[] { typeof(Renderer) };
Name = "Texture Theme";
NoEasing = true;
ThemeProperties.Add(
new InteractableThemeProperty()
{
Expand All @@ -29,8 +30,6 @@ public InteractableTextureTheme()
public override void Init(GameObject host, InteractableThemePropertySettings settings)
{
base.Init(host, settings);

settings.NoEasing = true;
propertyBlock = InteractableThemeShaderUtils.GetMaterialPropertyBlock(host, new ShaderProperties[0]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public abstract class InteractableThemeBase
public List<InteractableThemePropertyValue> CustomSettings = new List<InteractableThemePropertyValue>();
public GameObject Host;
public Easing Ease;
public bool NoEasing;
public bool Loaded;

private bool hasFirstState = false;
Expand All @@ -45,6 +46,7 @@ public virtual void Init(GameObject host, InteractableThemePropertySettings sett
prop.PropId = settings.Properties[i].PropId;
prop.Values = settings.Properties[i].Values;


ThemeProperties[i] = prop;
}

Expand Down Expand Up @@ -83,10 +85,11 @@ public virtual void OnUpdate(int state, bool force = false)
{
InteractableThemeProperty current = ThemeProperties[i];
current.StartValue = GetProperty(current);
if (hasFirstState)
if (hasFirstState || force)
{
Ease.Start();
SetValue(current, state, Ease.GetCurved());
hasFirstState = true;
}
else
{
Expand Down
Loading