浏览代码

Fix SceneAccessTool build fail issue (#274)

* Added the Quick Scene Access Tool

* removed unused file

* orgainized script for SceneAccessTool to their proper folders. Build should work now
/devlogs-3-input
GitHub 4 年前
当前提交
6e9b7f56
共有 12 个文件被更改,包括 75 次插入32 次删除
  1. 24
      UOP1_Project/Assets/Scripts/SceneManagement/ScriptableObjects/SceneAccessHolderSO.cs
  2. 8
      UOP1_Project/Assets/Scripts/Attributes.meta
  3. 8
      UOP1_Project/Assets/Scripts/Attributes/Editor.meta
  4. 30
      UOP1_Project/Assets/Scripts/Attributes/Editor/ReadOnlyDrawer.cs
  5. 11
      UOP1_Project/Assets/Scripts/Attributes/Editor/ReadOnlyDrawer.cs.meta
  6. 7
      UOP1_Project/Assets/Scripts/Attributes/ReadOnlyAttribute.cs
  7. 11
      UOP1_Project/Assets/Scripts/Attributes/ReadOnlyAttribute.cs.meta
  8. 8
      UOP1_Project/Assets/Scenes/Skybox/ClearSky.meta
  9. 0
      /UOP1_Project/Assets/Scripts/Editor/SceneAccessTool.cs
  10. 0
      /UOP1_Project/Assets/Scripts/Editor/SceneAccessTool.cs.meta

24
UOP1_Project/Assets/Scripts/SceneManagement/ScriptableObjects/SceneAccessHolderSO.cs


using System;
using System.Collections.Generic;
using UnityEditor;
public class ReadOnlyAttribute : PropertyAttribute
{
}
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
public class ReadOnlyDrawer : PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property,
GUIContent label)
{
return EditorGUI.GetPropertyHeight(property, label, true);
}
public override void OnGUI(Rect position,
SerializedProperty property,
GUIContent label)
{
GUI.enabled = false;
EditorGUI.PropertyField(position, property, label, true);
GUI.enabled = true;
}
}
/// <summary>
/// It holds a list of scenes that's shown in the scene quick access tool
/// </summary>

8
UOP1_Project/Assets/Scripts/Attributes.meta


fileFormatVersion: 2
guid: b20537032508d384c9b7e9decf64c3ae
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/Scripts/Attributes/Editor.meta


fileFormatVersion: 2
guid: 25c60a1b6ef3282498badf856df7d1e1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

30
UOP1_Project/Assets/Scripts/Attributes/Editor/ReadOnlyDrawer.cs


using UnityEngine;
using UnityEditor;
/// <summary>
/// This class contain custom drawer for ReadOnly attribute.
/// </summary>
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
public class ReadOnlyDrawer : PropertyDrawer
{
/// <summary>
/// Unity method for drawing GUI in Editor
/// </summary>
/// <param name="position">Position.</param>
/// <param name="property">Property.</param>
/// <param name="label">Label.</param>
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
// Saving previous GUI enabled value
var previousGUIState = GUI.enabled;
// Disabling edit for property
GUI.enabled = false;
// Drawing Property
EditorGUI.PropertyField(position, property, label);
// Setting old GUI enabled value
GUI.enabled = previousGUIState;
}
}

11
UOP1_Project/Assets/Scripts/Attributes/Editor/ReadOnlyDrawer.cs.meta


fileFormatVersion: 2
guid: 8be0eb3c422b9db4193a660915ecdd09
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

7
UOP1_Project/Assets/Scripts/Attributes/ReadOnlyAttribute.cs


using UnityEngine;
/// <summary>
/// Read Only attribute.
/// Attribute is use only to mark ReadOnly properties.
/// </summary>
public class ReadOnlyAttribute : PropertyAttribute { }

11
UOP1_Project/Assets/Scripts/Attributes/ReadOnlyAttribute.cs.meta


fileFormatVersion: 2
guid: 02575d91f97b73a4aa5801082ffca3a1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
UOP1_Project/Assets/Scenes/Skybox/ClearSky.meta


fileFormatVersion: 2
guid: b54dcdb53f77f3843ab02db68eaa42f6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

/UOP1_Project/Assets/Scripts/EditorTools/SceneAccessTool.cs → /UOP1_Project/Assets/Scripts/Editor/SceneAccessTool.cs

/UOP1_Project/Assets/Scripts/EditorTools/SceneAccessTool.cs.meta → /UOP1_Project/Assets/Scripts/Editor/SceneAccessTool.cs.meta

正在加载...
取消
保存