Netcode Bootstrap
This commit is contained in:
+106
@@ -0,0 +1,106 @@
|
||||
using Rukhanka.Toolbox;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Rukhanka.Editor
|
||||
{
|
||||
public class AvatarMaskInfoWindow : EditorWindow
|
||||
{
|
||||
[SerializeField]
|
||||
private VisualTreeAsset visualTreeAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset includedBoneNameInfoAsset = default;
|
||||
[SerializeField]
|
||||
private VisualTreeAsset entityRefAsset = default;
|
||||
|
||||
internal static BlobInspector.BlobAssetInfo<AvatarMaskBlob> avatarMaskBlob;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
var root = rootVisualElement;
|
||||
var doc = visualTreeAsset.Instantiate();
|
||||
root.Add(doc);
|
||||
|
||||
titleContent = new GUIContent("Rukhanka.Animation Avatar Mask Blob Info");
|
||||
FillAvatarMaskInfo();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe void FillAvatarMaskInfo()
|
||||
{
|
||||
ref var b = ref avatarMaskBlob.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.name.ToString();
|
||||
bakingTimeLabel.text = $"{b.bakingTime:F3} sec";
|
||||
#else
|
||||
nameLabel.text = "-";
|
||||
bakingTimeLabel.text = "-";
|
||||
#endif
|
||||
|
||||
var sizeLabel = rootVisualElement.Q<Label>("sizeLabel");
|
||||
sizeLabel.text = CommonTools.FormatMemory(avatarMaskBlob.blobAsset.m_data.Header->Length);
|
||||
|
||||
// Fill included bone names
|
||||
#if RUKHANKA_DEBUG_INFO
|
||||
ref var boneNames = ref b.includedBoneNames;
|
||||
var includedBonesFoldout = rootVisualElement.Q<Foldout>("includedBonesFoldout");
|
||||
includedBonesFoldout.text = $"{boneNames.Length} Included Bones";
|
||||
|
||||
for (var i = 0; i < boneNames.Length; ++i)
|
||||
{
|
||||
ref var bn = ref boneNames[i];
|
||||
var includeBodyPartUIEntry = includedBoneNameInfoAsset.Instantiate();
|
||||
|
||||
if (i % 2 == 0)
|
||||
includeBodyPartUIEntry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var nameLabelP = includeBodyPartUIEntry.Q<Label>("nameLabel");
|
||||
nameLabelP.text = bn.ToString();
|
||||
includedBonesFoldout.Add(includeBodyPartUIEntry);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Fill included human body parts names
|
||||
var humanBodyPartsFoldout = rootVisualElement.Q<Foldout>("humanBodyPartsFoldout");
|
||||
var totalPartsCount = 0;
|
||||
var humanBodyPartsCount = (int)AvatarMaskBodyPart.LastBodyPart;
|
||||
for (int i = 0; i < humanBodyPartsCount; ++i)
|
||||
{
|
||||
var ambp = (AvatarMaskBodyPart)i;
|
||||
if ((b.humanBodyPartsAvatarMask & 1 << i) != 0)
|
||||
{
|
||||
var humanBodyPartUIEntry = includedBoneNameInfoAsset.Instantiate();
|
||||
|
||||
if (i % 2 == 0)
|
||||
humanBodyPartUIEntry.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
|
||||
|
||||
var nameLabelP = humanBodyPartUIEntry.Q<Label>("nameLabel");
|
||||
var hashLabelP = humanBodyPartUIEntry.Q<Label>("hashLabel");
|
||||
|
||||
nameLabelP.text = ambp.ToString();
|
||||
hashLabelP.text = i.ToString();
|
||||
|
||||
humanBodyPartsFoldout.Add(humanBodyPartUIEntry);
|
||||
totalPartsCount++;
|
||||
}
|
||||
}
|
||||
humanBodyPartsFoldout.text = $"{totalPartsCount} Included Human Body Parts";
|
||||
|
||||
// Referenced entities view
|
||||
var relatedEntitiesView = rootVisualElement.Q("relatedEntitiesView");
|
||||
var relatedEntitieLabel = rootVisualElement.Q<Label>("relatedEntitiesLabel");
|
||||
AnimatorClipBlobInfoWindow.PopulateReferencedEntities(relatedEntitiesView, relatedEntitieLabel, avatarMaskBlob.refEntities, entityRefAsset);
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 294ab3a893cd38640a0012da8d97c839
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- m_ViewDataDictionary: {instanceID: 0}
|
||||
- visualTreeAsset: {fileID: 9197481963319205126, guid: 6ca489fd9028a3142bff9e42f2868ae3, type: 3}
|
||||
- includedBoneNameInfoAsset: {fileID: 9197481963319205126, guid: 6359bcda08d7e544f9f48ab95859de29, 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/AvatarMaskInfoWindow/AvatarMaskInfoWindow.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: 16713f8956625e44fad249eca2490acd
|
||||
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/AvatarMaskInfoWindow/AvatarMaskInfoWindow.uss
|
||||
uploadId: 897522
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<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/AvatarMaskInfoWindow/AvatarMaskInfoWindow.uss?fileID=7433441132597879392&guid=16713f8956625e44fad249eca2490acd&type=3#AvatarMaskInfoWindow" />
|
||||
<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: 143px; 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: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:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:ScrollView scroll-deceleration-rate="0,135" elasticity="0,1" 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="includedBonesFoldout" value="false" style="align-items: stretch;" />
|
||||
<ui:Foldout text="Foldout" value="false" name="humanBodyPartsFoldout" />
|
||||
</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: 6ca489fd9028a3142bff9e42f2868ae3
|
||||
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/AvatarMaskInfoWindow/AvatarMaskInfoWindow.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" parse-escape-sequences="true" display-tooltip-when-elided="true" name="hashLabel" style="width: 332px; border-right-color: rgb(127, 127, 127); border-right-width: 1px;" />
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" style="flex-grow: 1;" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6359bcda08d7e544f9f48ab95859de29
|
||||
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/AvatarMaskInfoWindow/IncludedBoneNameInfoAsset.uxml
|
||||
uploadId: 897522
|
||||
Reference in New Issue
Block a user