upgrade CCK to v3.5
This commit is contained in:
parent
6fe98b333d
commit
3005cfc8aa
43 changed files with 1213 additions and 289 deletions
|
@ -1,7 +1,9 @@
|
|||
using System.Collections;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR;
|
||||
|
||||
#pragma warning disable
|
||||
|
||||
|
@ -13,13 +15,25 @@ public class CCK_Init
|
|||
|
||||
void SetTag(SerializedProperty tags, string name, int index)
|
||||
{
|
||||
SerializedProperty sp = tags.GetArrayElementAtIndex(index);
|
||||
SerializedProperty sp = null;
|
||||
try
|
||||
{
|
||||
sp = tags.GetArrayElementAtIndex(index);
|
||||
}
|
||||
catch{}
|
||||
|
||||
if (sp != null) sp.stringValue = name;
|
||||
}
|
||||
|
||||
void SetLayer(SerializedProperty layers, string name, int index)
|
||||
{
|
||||
SerializedProperty sp = layers.GetArrayElementAtIndex(index);
|
||||
SerializedProperty sp = null;
|
||||
try
|
||||
{
|
||||
sp = layers.GetArrayElementAtIndex(index);
|
||||
}
|
||||
catch{}
|
||||
|
||||
if (sp != null) sp.stringValue = name;
|
||||
}
|
||||
|
||||
|
@ -73,17 +87,33 @@ public class CCK_Init
|
|||
tagManager.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
#if UNITY_2021_1_OR_NEWER
|
||||
if (true)
|
||||
#else
|
||||
if (!PlayerSettings.virtualRealitySupported)
|
||||
#endif
|
||||
{
|
||||
Debug.Log("[CCK:Init] XR and render settings have to be changed. Now changing.");
|
||||
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64);
|
||||
#if PLATFORM_ANDROID
|
||||
if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android)
|
||||
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, BuildTarget.Android);
|
||||
#else
|
||||
if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.StandaloneWindows64)
|
||||
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64);
|
||||
#endif
|
||||
PlayerSettings.colorSpace = UnityEngine.ColorSpace.Linear;
|
||||
|
||||
PlayerSettings.apiCompatibilityLevel = ApiCompatibilityLevel.NET_4_6;
|
||||
|
||||
#if UNITY_2021_1_OR_NEWER
|
||||
PlayerSettings.virtualRealitySupported = true;
|
||||
PlayerSettings.stereoRenderingPath = StereoRenderingPath.Instancing;
|
||||
XRSettings.enabled = false;
|
||||
#else
|
||||
PlayerSettings.virtualRealitySupported = true;
|
||||
PlayerSettings.SetVirtualRealitySDKs(BuildTargetGroup.Standalone, new string[] { "None", "Oculus", "OpenVR", "MockHMD" });
|
||||
PlayerSettings.stereoRenderingPath = StereoRenderingPath.SinglePass;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (LayerMask.LayerToName(10) == "PlayerNetwork" && LayerMask.LayerToName(17) == "CVRPickup" && LayerMask.LayerToName(15) == "CVRReserved4" && PlayerSettings.virtualRealitySupported )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue