Skip to content

Commit

Permalink
C# 4.0 complience
Browse files Browse the repository at this point in the history
  • Loading branch information
weeeBox committed Aug 8, 2020
1 parent 5f0f82d commit cc4cde3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Project/Assets/LunarConsole/Scripts/Actions/CVar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,14 @@ public T EnumValue
get { return m_valueLookup[Value]; }
}

#if UNITY_2017_1_OR_NEWER

public static implicit operator T(CEnumVar<T> cvar)
{
return cvar.EnumValue;
}

#endif
}

public class CVarList : IEnumerable<CVar>
Expand Down
4 changes: 2 additions & 2 deletions Project/Assets/Scripts/VariablesScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private void Start()
for (var index = 0; index < m_variables.Length; index++)
{
var cvar = m_variables[index];
m_variableLabels[index].text = $"{cvar.Name}: {cvar.Value}";
m_variableLabels[index].text = string.Format("{0}: {1}", cvar.Name, cvar.Value);
}

foreach (CVar cvar in m_variables)
Expand All @@ -64,6 +64,6 @@ private void OnDestroy()
private void OnVariableChanged(CVar cvar)
{
int index = Array.IndexOf(m_variables, cvar);
m_variableLabels[index].text = $"{cvar.Name}: {cvar.Value}";
m_variableLabels[index].text = string.Format("{0}: {1}", cvar.Name, cvar.Value);
}
}

0 comments on commit cc4cde3

Please sign in to comment.