Skip to content

Commit

Permalink
Fixed build compiler error
Browse files Browse the repository at this point in the history
* Added preprocessor checks for editor only code in runtime class
  • Loading branch information
jzapdot committed Feb 6, 2022
1 parent 159b0e7 commit 17832ea
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public CodeGenFile CreateSymbolFactoryCodeGenFile(SymbolFactoryData data)
using System.Collections.Generic;
using UnityEngine;
#if ODIN_INSPECTOR
#if ODIN_INSPECTOR && UNITY_EDITOR
using System.Linq;
using Sirenix.Utilities.Editor;
using Sirenix.OdinInspector;
Expand All @@ -119,20 +119,20 @@ public sealed partial class ${TypeName} : ScriptableObject
[Serializable]
private class Mapping
{
#if ODIN_INSPECTOR
#if ODIN_INSPECTOR && UNITY_EDITOR
[FoldoutGroup(""@key"")]
#endif
#pragma warning disable 0649
public ${KeyFullType} key;
#if ODIN_INSPECTOR
#if ODIN_INSPECTOR && UNITY_EDITOR
[FoldoutGroup(""@key"")]
#endif
public ${ValueFullType} value;
#pragma warning restore 0649
}
#if ODIN_INSPECTOR
#if ODIN_INSPECTOR && UNITY_EDITOR
[ValidateInput(nameof(EnsureAllKeyValuesAreUnique),
""Not all Key values are unique, please ensure each one is unique."")]
[ListDrawerSettings(
Expand Down Expand Up @@ -206,7 +206,7 @@ public bool TryGetValue(${KeyFullType} key, out ${ValueFullType} value)
return true;
}
#if ODIN_INSPECTOR
#if ODIN_INSPECTOR && UNITY_EDITOR
private bool EnsureAllKeyValuesAreUnique(List<Mapping> values)
{
return values.GroupBy(x => x.key).All(x => x.Count() < 2);
Expand Down Expand Up @@ -301,8 +301,7 @@ private class Mapping
#if ODIN_INSPECTOR
[ListDrawerSettings(
Expanded = true,
ShowIndexLabels = false
)]
ShowIndexLabels = false)]
#endif
#pragma warning disable 0649
[SerializeField]
Expand Down

0 comments on commit 17832ea

Please sign in to comment.