init project
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#if HAS_ENTITIES_PACKAGE
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using Unity.Scenes;
|
||||
|
||||
using Unity.PlasticSCM.Editor.AssetsOverlays;
|
||||
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Unity.PlasticSCM.Editor.Entities
|
||||
{
|
||||
internal class GetSubScenePathFromInstance : DrawHierarchyOverlay.IGetAssetPathFromInstance
|
||||
{
|
||||
internal static void Register()
|
||||
{
|
||||
DrawHierarchyOverlay.GetSubSceneAssetPath = new GetSubScenePathFromInstance();
|
||||
}
|
||||
|
||||
bool DrawHierarchyOverlay.IGetAssetPathFromInstance.TryGetAssetPath(
|
||||
int instanceID,
|
||||
out string assetPath)
|
||||
{
|
||||
assetPath = null;
|
||||
|
||||
Object hierarchyObject = FindUnityObject.ForInstanceID(instanceID);
|
||||
|
||||
if (hierarchyObject == null || hierarchyObject is not GameObject)
|
||||
return false;
|
||||
|
||||
assetPath = GetSubScenePathFromGameObject((GameObject) hierarchyObject);
|
||||
|
||||
return assetPath != null;
|
||||
}
|
||||
|
||||
string GetSubScenePathFromGameObject(GameObject gameObject)
|
||||
{
|
||||
SubScene subSceneComponent = gameObject.GetComponent<SubScene>();
|
||||
|
||||
return subSceneComponent == null ? null : subSceneComponent.EditableScenePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7785ffd4a2444038c73d694d2bf3a80
|
||||
timeCreated: 1750690714
|
||||
@@ -0,0 +1,15 @@
|
||||
#if HAS_ENTITIES_PACKAGE
|
||||
using UnityEditor;
|
||||
|
||||
namespace Unity.PlasticSCM.Editor.Entities
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
internal static class HierarchyExtensions
|
||||
{
|
||||
static HierarchyExtensions()
|
||||
{
|
||||
GetSubScenePathFromInstance.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe6ad6eb139a49f4a02d9794e934bd9c
|
||||
timeCreated: 1751532493
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "Unity.PlasticSCM.Editor.Entities",
|
||||
"references": [
|
||||
"Unity.PlasticSCM.Editor",
|
||||
"Unity.Scenes"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": false,
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "com.unity.entities",
|
||||
"expression": "1.0.8",
|
||||
"define": "HAS_ENTITIES_PACKAGE"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c24d342672367b243aff1910ea83a56d
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user