Class ConditionalCompilationUtility | Unity Reflect | 1.1.0-preview.6
docs.unity.cn
    Show / Hide Table of Contents

    Class ConditionalCompilationUtility

    The Conditional Compilation Utility (CCU) will add defines to the build settings once dependent classes have been detected. In order for this to be specified in any project without the project needing to include the CCU, at least one custom attribute must be created in the following form:

    [Conditional(UNITY_CCU)] // | This is necessary for CCU to pick up the right attributes public class OptionalDependencyAttribute : Attribute // | Must derive from System.Attribute { public string dependentClass; // | Required field specifying the fully qualified dependent class public string define; // | Required field specifying the define to add }

    Then, simply specify the assembly attribute(s) you created: [assembly: OptionalDependency("UnityEngine.InputNew.InputSystem", "USE_NEW_INPUT")] [assembly: OptionalDependency("Valve.VR.IVRSystem", "ENABLE_STEAMVR_INPUT")]

    namespace Foo { ... }

    Inheritance
    Object
    ConditionalCompilationUtility
    Namespace: Unity.Labs.Utils
    Syntax
    public static class ConditionalCompilationUtility

    Properties

    defines

    Declaration
    public static string[] defines { get; }
    Property Value
    Type Description
    String[]

    enabled

    Declaration
    public static bool enabled { get; }
    Property Value
    Type Description
    Boolean
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX