Netcode Bootstrap
This commit is contained in:
+123
@@ -0,0 +1,123 @@
|
||||
using Rukhanka.Toolbox;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
public class SkinnedMeshBlobInfoWindow : EditorWindow
|
||||
{
|
||||
[SerializeField]
|
||||
private VisualTreeAsset visualTreeAsset = default;
|
||||
|
||||
[SerializeField]
|
||||
private VisualTreeAsset boneInfoAsset = default;
|
||||
|
||||
[SerializeField]
|
||||
private VisualTreeAsset entityRefAsset = default;
|
||||
|
||||
internal static BlobInspector.BlobAssetInfo<SkinnedMeshInfoBlob> skinnedMeshBlob;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
var root = rootVisualElement;
|
||||
var doc = visualTreeAsset.Instantiate();
|
||||
root.Add(doc);
|
||||
|
||||
titleContent = new GUIContent("Rukhanka.Animation Skinned Mesh Mask Info");
|
||||
FillSkinnedMeshInfo();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe void FillSkinnedMeshInfo()
|
||||
{
|
||||
ref var b = ref skinnedMeshBlob.blobAsset.Value;
|
||||
var hashLabel = rootVisualElement.Q<Label>("hashLabel");
|
||||
hashLabel.text = b.hash.ToString();
|
||||
|
||||
var nameLabel = rootVisualElement.Q<Label>("nameLabel");
|
||||
var bakingTimeLabel = rootVisualElement.Q<Label>("bakingTimeLabel");
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameLabel.text = b.skeletonName.ToString();
|
||||
bakingTimeLabel.text = $"{b.bakingTime:F3} sec";
|
||||
#else
|
||||
nameLabel.text = "-";
|
||||
bakingTimeLabel.text = "-";
|
||||
#endif
|
||||
|
||||
var sizeLabel = rootVisualElement.Q<Label>("sizeLabel");
|
||||
sizeLabel.text = CommonTools.FormatMemory(skinnedMeshBlob.blobAsset.m_data.Header->Length);
|
||||
|
||||
var verticesCountLabel = rootVisualElement.Q<Label>("verticesCountLabel");
|
||||
verticesCountLabel.text = $"{b.meshVerticesCount}";
|
||||
|
||||
var boneWeightsCountLabel = rootVisualElement.Q<Label>("boneWeightsCountLabel");
|
||||
boneWeightsCountLabel.text = $"{b.meshBoneWeightsCount}";
|
||||
|
||||
ref var bones = ref b.bones;
|
||||
|
||||
// Fill bone data
|
||||
var bonesFoldout = rootVisualElement.Q<Foldout>("bonesFoldout");
|
||||
bonesFoldout.text = $"{bones.Length} Bones";
|
||||
|
||||
bonesFoldout.Add(boneInfoAsset.Instantiate());
|
||||
for (var i = 0; i < bones.Length; ++i)
|
||||
{
|
||||
ref var bone = ref bones[i];
|
||||
var boneInfoUIEntry = boneInfoAsset.Instantiate();
|
||||
if (i % 2 == 0)
|
||||
boneInfoUIEntry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var hashLabelB = boneInfoUIEntry.Q<Label>("hashLabel");
|
||||
var nameLabelB = boneInfoUIEntry.Q<Label>("nameLabel");
|
||||
//var bindPoseLabelB = boneInfoUIEntry.Q<Label>("bindPoseLabel");
|
||||
|
||||
hashLabelB.text = bone.hash.ToString();
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameLabelB.text = bone.name.ToString();
|
||||
#else
|
||||
nameLabelB.text = "-";
|
||||
#endif
|
||||
//bindPoseLabelB.text = bone.bindPose.ToString();
|
||||
|
||||
bonesFoldout.Add(boneInfoUIEntry);
|
||||
}
|
||||
|
||||
// Fill blend shapes data
|
||||
var blendShapesFoldout = rootVisualElement.Q<Foldout>("blendShapesFoldout");
|
||||
ref var blendShapes = ref b.blendShapes;
|
||||
blendShapesFoldout.text = $"{blendShapes.Length} Blend Shapes";
|
||||
|
||||
blendShapesFoldout.Add(boneInfoAsset.Instantiate());
|
||||
for (var i = 0; i < blendShapes.Length; ++i)
|
||||
{
|
||||
ref var bs = ref blendShapes[i];
|
||||
var boneInfoUIEntry = boneInfoAsset.Instantiate();
|
||||
if (i % 2 == 0)
|
||||
boneInfoUIEntry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var hashLabelB = boneInfoUIEntry.Q<Label>("hashLabel");
|
||||
var nameLabelB = boneInfoUIEntry.Q<Label>("nameLabel");
|
||||
|
||||
hashLabelB.text = bs.hash.ToString();
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
nameLabelB.text = bs.name.ToString();
|
||||
#else
|
||||
nameLabelB.text = "-";
|
||||
#endif
|
||||
|
||||
blendShapesFoldout.Add(boneInfoUIEntry);
|
||||
}
|
||||
|
||||
// Referenced entities view
|
||||
var relatedEntitiesView = rootVisualElement.Q("relatedEntitiesView");
|
||||
var relatedEntitieLabel = rootVisualElement.Q<Label>("relatedEntitiesLabel");
|
||||
AnimatorClipBlobInfoWindow.PopulateReferencedEntities(relatedEntitiesView, relatedEntitieLabel, skinnedMeshBlob.refEntities, entityRefAsset);
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81ee75d06dc383a42b4f763d5cf13fe7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_ViewDataDictionary: {instanceID: 0}
|
||||
- visualTreeAsset: {fileID: 9197481963319205126, guid: 06c6e9527627135448712b749ece8773, type: 3}
|
||||
- boneInfoAsset: {fileID: 9197481963319205126, guid: c9320b9b2ed0f1942a921cdc76fd4072, type: 3}
|
||||
- entityRefAsset: {fileID: 9197481963319205126, guid: dba65a86cda2861448a7ae7891041b16, type: 3}
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/SkinnedMeshBlobInfoWindow/SkinnedMeshBlobInfoWindow.cs
|
||||
uploadId: 897522
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
.custom-label {
|
||||
font-size: 20px;
|
||||
-unity-font-style: bold;
|
||||
color: rgb(68, 138, 255);
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e371b466073a1848895a5824af0da1b
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||
disableValidation: 0
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/SkinnedMeshBlobInfoWindow/SkinnedMeshBlobInfoWindow.uss
|
||||
uploadId: 897522
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
|
||||
<Style src="project://database/Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/SkinnedMeshBlobInfoWindow/SkinnedMeshBlobInfoWindow.uss?fileID=7433441132597879392&guid=6e371b466073a1848895a5824af0da1b&type=3#SkinnedMeshBlobInfoWindow" />
|
||||
<ui:VisualElement style="flex-grow: 1; border-left-color: rgb(127, 127, 127); border-right-color: rgb(127, 127, 127); border-top-color: rgb(127, 127, 127); border-bottom-color: rgb(127, 127, 127); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px;">
|
||||
<ui:VisualElement style="flex-grow: 0; flex-direction: row; flex-shrink: 0;">
|
||||
<ui:VisualElement style="flex-grow: 0; width: 164px; flex-shrink: 0;">
|
||||
<ui:Label tabindex="-1" text="Hash128:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
<ui:Label tabindex="-1" text="Name:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
|
||||
<ui:Label tabindex="-1" text="Baking TIme:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Size:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Vertices Count:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
<ui:Label tabindex="-1" text="Bone Weights Count:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement style="flex-grow: 1;">
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="hashLabel" />
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="bakingTimeLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="sizeLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="verticesCountLabel" />
|
||||
<ui:Label tabindex="-1" text="asda" parse-escape-sequences="true" display-tooltip-when-elided="true" name="boneWeightsCountLabel" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:ScrollView scroll-deceleration-rate="0,135" elasticity="0,1" mode="VerticalAndHorizontal" style="flex-grow: 1; border-left-color: rgb(127, 127, 127); border-right-color: rgb(127, 127, 127); border-top-color: rgb(127, 127, 127); border-bottom-color: rgb(127, 127, 127); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; margin-top: 5px; padding-top: 3px; padding-right: 0; padding-bottom: 3px; padding-left: 0;">
|
||||
<ui:Foldout text="Foldout" name="bonesFoldout" value="false" style="align-items: stretch;" />
|
||||
<ui:Foldout text="Foldout" name="blendShapesFoldout" value="false" style="align-items: stretch;" />
|
||||
</ui:ScrollView>
|
||||
<ui:Label tabindex="-1" text="Related Entities" parse-escape-sequences="true" display-tooltip-when-elided="true" name="relatedEntitiesLabel" style="padding-top: 10px;" />
|
||||
<ui:ScrollView scroll-deceleration-rate="0,135" elasticity="0,1" name="relatedEntitiesView" style="flex-grow: 1; border-left-color: rgb(127, 127, 127); border-right-color: rgb(127, 127, 127); border-top-color: rgb(127, 127, 127); border-bottom-color: rgb(127, 127, 127); border-top-width: 0; border-right-width: 0; border-bottom-width: 0; border-left-width: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06c6e9527627135448712b749ece8773
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/SkinnedMeshBlobInfoWindow/SkinnedMeshBlobInfoWindow.uxml
|
||||
uploadId: 897522
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
|
||||
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
|
||||
<ui:Label tabindex="-1" text="Hash" parse-escape-sequences="true" display-tooltip-when-elided="true" name="hashLabel" style="width: 296px; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Name" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" style="flex-grow: 1; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9320b9b2ed0f1942a921cdc76fd4072
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 298480
|
||||
packageName: Rukhanka Animation System 2
|
||||
packageVersion: 2.9.0
|
||||
assetPath: Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/SkinnedMeshBlobInfoWindow/SkinnedMeshBoneInfoEntry.uxml
|
||||
uploadId: 897522
|
||||
Reference in New Issue
Block a user