update CCK to 3.10, fixing unity 2021 crash :)
This commit is contained in:
parent
48a978fa2a
commit
d11e0fb3a9
492 changed files with 2165204 additions and 437687 deletions
|
@ -0,0 +1,89 @@
|
|||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using static ABI.CCK.Scripts.Editor.SharedComponentGUI;
|
||||
|
||||
namespace ABI.CCK.Components
|
||||
{
|
||||
[CanEditMultipleObjects]
|
||||
[CustomEditor(typeof(CVRCameraHelper))]
|
||||
public partial class CCK_CVRCameraHelperEditor : Editor
|
||||
{
|
||||
#region EditorGUI Foldouts
|
||||
|
||||
private static bool _guiCameraSettingsFoldout = true;
|
||||
private static bool _guiShaderSettingsFoldout = true;
|
||||
|
||||
#endregion
|
||||
|
||||
private CVRCameraHelper _cameraHelper;
|
||||
|
||||
private CVRAvatar _validAvatar;
|
||||
private CVRSpawnable _validSpawnable;
|
||||
private CVRPickupObject _validPickup;
|
||||
|
||||
private SerializedProperty m_CamProp;
|
||||
private SerializedProperty m_SetAsMirroringCamera;
|
||||
|
||||
private SerializedProperty m_SelectedShaderProp;
|
||||
private SerializedProperty m_ReplacementShadersProp;
|
||||
|
||||
#region Unity Events
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (target == null) return;
|
||||
_cameraHelper = (CVRCameraHelper)target;
|
||||
|
||||
_validAvatar = _cameraHelper.GetComponentInParent<CVRAvatar>();
|
||||
_validSpawnable = _cameraHelper.GetComponentInParent<CVRSpawnable>();
|
||||
_validPickup = _cameraHelper.GetComponentInParent<CVRPickupObject>();
|
||||
|
||||
m_CamProp = serializedObject.FindProperty(nameof(CVRCameraHelper.cam));
|
||||
m_SetAsMirroringCamera = serializedObject.FindProperty(nameof(CVRCameraHelper.setAsMirroringCamera));
|
||||
m_SelectedShaderProp = serializedObject.FindProperty(nameof(CVRCameraHelper.selectedShader));
|
||||
m_ReplacementShadersProp = serializedObject.FindProperty(nameof(CVRCameraHelper.replacementShaders));
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (_cameraHelper == null)
|
||||
return;
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
Draw_Info();
|
||||
Draw_AvatarError();
|
||||
Draw_PropWarning();
|
||||
|
||||
Draw_CameraSettings();
|
||||
Draw_ShaderSettings();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Drawing Methods
|
||||
|
||||
private void Draw_Info()
|
||||
{
|
||||
EditorGUILayout.HelpBox("For use with Animation Events. Allows you to call TakeScreenshot to save the Camera Render Texture output. Limited to once per second.", MessageType.Info);
|
||||
}
|
||||
|
||||
private void Draw_AvatarError()
|
||||
{
|
||||
if (_validAvatar != null)
|
||||
EditorGUILayout.HelpBox("CVRCameraHelper is not currently allowed on Avatars!", MessageType.Error);
|
||||
}
|
||||
|
||||
private void Draw_PropWarning()
|
||||
{
|
||||
if (_validSpawnable && !_validPickup)
|
||||
EditorGUILayout.HelpBox("CVRPickupObject is missing in hierarchy. CVRCameraHelper must be held while on a prop for TakeScreenshot to work.", MessageType.Warning);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 62a5cb12ce47ac24c8feeece7cd8c3ee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,33 @@
|
|||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using static ABI.CCK.Scripts.Editor.SharedComponentGUI;
|
||||
|
||||
namespace ABI.CCK.Components
|
||||
{
|
||||
public partial class CCK_CVRCameraHelperEditor
|
||||
{
|
||||
private void Draw_CameraSettings()
|
||||
{
|
||||
using (new FoldoutScope(ref _guiCameraSettingsFoldout, "Camera Settings"))
|
||||
{
|
||||
if (!_guiCameraSettingsFoldout) return;
|
||||
using (new EditorGUI.IndentLevelScope())
|
||||
DrawCameraSettings();
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawCameraSettings()
|
||||
{
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
EditorGUILayout.PropertyField(m_CamProp, new GUIContent("Camera"));
|
||||
|
||||
// This option is not implemented. Leaving in GUI though as it fills the space nicely. :)
|
||||
EditorGUILayout.PropertyField(m_SetAsMirroringCamera, new GUIContent("Mirroring Camera"));
|
||||
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ad8ddcdf1a622954f8c4c751d42aa592
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,31 @@
|
|||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using static ABI.CCK.Scripts.Editor.SharedComponentGUI;
|
||||
|
||||
namespace ABI.CCK.Components
|
||||
{
|
||||
public partial class CCK_CVRCameraHelperEditor
|
||||
{
|
||||
private void Draw_ShaderSettings()
|
||||
{
|
||||
using (new FoldoutScope(ref _guiShaderSettingsFoldout, "Shader Settings"))
|
||||
{
|
||||
if (!_guiShaderSettingsFoldout) return;
|
||||
using (new EditorGUI.IndentLevelScope())
|
||||
DrawShaderSettings();
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawShaderSettings()
|
||||
{
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
EditorGUILayout.PropertyField(m_SelectedShaderProp, new GUIContent("Selected Shader"));
|
||||
EditorGUILayout.PropertyField(m_ReplacementShadersProp, new GUIContent("Replacement Shaders"), true);
|
||||
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 568a1ae7b6a604345a673aedc2d1cfef
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue