Add MIRROR define and version (#437)

* Add MIRROR define and version

* Update PreprocessorDefine.cs
This commit is contained in:
Paul Pacheco 2019-02-24 13:35:14 -06:00 committed by vis2k
parent 34392915c8
commit 7323d450ad
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,32 @@
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Mirror
{
static class PreprocessorDefine
{
/// <summary>
/// Symbols that will be added to the editor
/// </summary>
public static readonly string[] Symbols = new string[] {
"MIRROR",
"MIRROR_1726_OR_NEWER"
};
/// <summary>
/// Add define symbols as soon as Unity gets done compiling.
/// </summary>
[InitializeOnLoadMethod]
static void AddDefineSymbols()
{
string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
List<string> allDefines = definesString.Split(';').ToList();
allDefines.AddRange(Symbols.Except(allDefines));
PlayerSettings.SetScriptingDefineSymbolsForGroup(
EditorUserBuildSettings.selectedBuildTargetGroup,
string.Join(";", allDefines.ToArray()));
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f1d66fe74ec6f42dd974cba37d25d453
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: