mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Add MIRROR define and version (#437)
* Add MIRROR define and version * Update PreprocessorDefine.cs
This commit is contained in:
parent
34392915c8
commit
7323d450ad
32
Assets/Mirror/Editor/PreprocessorDefine.cs
Normal file
32
Assets/Mirror/Editor/PreprocessorDefine.cs
Normal 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()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Mirror/Editor/PreprocessorDefine.cs.meta
Normal file
11
Assets/Mirror/Editor/PreprocessorDefine.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f1d66fe74ec6f42dd974cba37d25d453
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user