Netcode Bootstrap

This commit is contained in:
Luis Gonzalez
2026-05-31 14:27:52 -07:00
parent 99d8d2d2a9
commit 7fa77ce821
1813 changed files with 2921554 additions and 84 deletions
@@ -0,0 +1,11 @@
<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="True">
<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: 75px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
<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:Label tabindex="-1" text="Time" parse-escape-sequences="true" display-tooltip-when-elided="true" name="timeLabel" style="width: 120px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
<ui:Label tabindex="-1" text="Float" parse-escape-sequences="true" display-tooltip-when-elided="true" name="floatParamLabel" style="width: 120px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
<ui:Label tabindex="-1" text="Int" parse-escape-sequences="true" display-tooltip-when-elided="true" name="intParamLabel" style="width: 120px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
<ui:Label tabindex="-1" text="String" parse-escape-sequences="true" display-tooltip-when-elided="true" name="stringParamLabel" style="width: 120px; border-right-width: 1px; border-right-color: rgb(127, 127, 127);" />
<ui:Label tabindex="-1" text="String Hash" parse-escape-sequences="true" display-tooltip-when-elided="true" name="stringHashParamLabel" style="width: 120px;" />
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: d48924796ce90364db884e5b7593aa47
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/AnimationClipBlobInfoWindow/AnimationEventBlobInfo.uxml
uploadId: 897522
@@ -0,0 +1,192 @@
using System.Collections.Generic;
using Rukhanka.Toolbox;
using Unity.Entities;
using Unity.Mathematics;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace Rukhanka.Editor
{
public class AnimatorClipBlobInfoWindow : EditorWindow
{
[SerializeField]
private VisualTreeAsset visualTreeAsset = default;
[SerializeField]
private VisualTreeAsset trackGroupBlobInfoAsset = default;
[SerializeField]
private VisualTreeAsset trackBlobInfoAsset = default;
[SerializeField]
private VisualTreeAsset animationEventInfoAsset = default;
[SerializeField]
private VisualTreeAsset entityRefAsset = default;
internal static BlobInspector.BlobAssetInfo<AnimationClipBlob> animationClipBlob;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void CreateGUI()
{
var root = rootVisualElement;
var doc = visualTreeAsset.Instantiate();
root.Add(doc);
titleContent = new GUIContent("Rukhanka.Animation Clip Blob Info");
FillBlobInfo();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
unsafe void FillBlobInfo()
{
ref var b = ref animationClipBlob.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 lengthLabel = rootVisualElement.Q<Label>("lengthLabel");
lengthLabel.text = $"{b.length:F3} sec";
var cycleOffsetLabel = rootVisualElement.Q<Label>("cycleOffsetLabel");
cycleOffsetLabel.text = $"{b.cycleOffset}";
var loopedCheckBox = rootVisualElement.Q<Toggle>("loopedCheckBox");
loopedCheckBox.SetEnabled(false);
loopedCheckBox.value = b.looped;
var loopPoseBlendCheckBox = rootVisualElement.Q<Toggle>("loopPoseBlendCheckBox");
loopPoseBlendCheckBox.SetEnabled(false);
loopPoseBlendCheckBox.value = b.loopPoseBlend;
var sizeLabel = rootVisualElement.Q<Label>("sizeLabel");
sizeLabel.text = CommonTools.FormatMemory(animationClipBlob.blobAsset.m_data.Header->Length);
FillTrackSetFoldout("clipTracksInfoFoldout", "Clip Tracks", ref b.clipTracks);
FillTrackSetFoldout("additiveRefPoseTrackSetInfoFoldout", "Additive Ref Pose Tracks", ref b.additiveReferencePoseFrame);
ref var events = ref b.events;
var animationEventsInfoFoldout = rootVisualElement.Q<Foldout>("animationEventsInfoFoldout");
animationEventsInfoFoldout.text = $"{events.Length} Animation Events";
animationEventsInfoFoldout.Add(animationEventInfoAsset.Instantiate());
for (var i = 0; i < events.Length; ++i)
{
var eventInfo = animationEventInfoAsset.Instantiate();
if (i % 2 == 0)
eventInfo.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
ref var evt = ref events[i];
var hashLabelE = eventInfo.Q<Label>("hashLabel");
var nameLabelE = eventInfo.Q<Label>("nameLabel");
var timeLabelE = eventInfo.Q<Label>("timeLabel");
var floatParamLabelE = eventInfo.Q<Label>("floatParamLabel");
var intParamLabelE = eventInfo.Q<Label>("intParamLabel");
var stringParamTabelE = eventInfo.Q<Label>("stringParamLabel");
var stringHashParamTabelE = eventInfo.Q<Label>("stringHashParamLabel");
#if RUKHANKA_DEBUG_INFO
nameLabelE.text = evt.name.ToString();
stringParamTabelE.text = evt.stringParam.ToString();
#else
nameLabelE.text = "-";
stringParamTabelE.text = "-";
#endif
hashLabelE.text = evt.nameHash.ToString();
timeLabelE.text = evt.time.ToString();
floatParamLabelE.text = evt.floatParam.ToString();
intParamLabelE.text = evt.intParam.ToString();
stringHashParamTabelE.text = evt.stringParamHash.ToString();
animationEventsInfoFoldout.Add(eventInfo);
}
var relatedEntitiesView = rootVisualElement.Q("relatedEntitiesView");
var relatedEntitieLabel = rootVisualElement.Q<Label>("relatedEntitiesLabel");
PopulateReferencedEntities(relatedEntitiesView, relatedEntitieLabel, animationClipBlob.refEntities, entityRefAsset);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
internal static void PopulateReferencedEntities(VisualElement container, Label containerLabel, List<Entity> entities, VisualTreeAsset entryAsset)
{
containerLabel.text = $"{entities.Count} Related Entities";
for (var i = 0; i < entities.Count; ++i)
{
var e = entities[i];
var element = entryAsset.Instantiate();
var entityIDLabel = element.Q<Label>("entityIDLabel");
var nameLabel = element.Q<Label>("nameLabel");
entityIDLabel.text = e.ToString();
if (BlobInspector.currentWorld != null)
nameLabel.text = BlobInspector.currentWorld.EntityManager.GetName(e);
container.Add(element);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void FillTrackSetFoldout(string foldoutName, string caption, ref TrackSet ts)
{
var trackSetInfoFoldout = rootVisualElement.Q<Foldout>(foldoutName);
trackSetInfoFoldout.text = $"{ts.trackGroups.Length} {caption}";
for (int i = 0; i < ts.trackGroups.Length - 1; ++i)
{
var tgRange = new int2(ts.trackGroups[i], ts.trackGroups[i + 1]);
var trackGroupInfo = trackGroupBlobInfoAsset.Instantiate();
if (i % 2 == 0)
trackGroupInfo.style.backgroundColor = new StyleColor(new Color(0.3f, 0.3f, 0.3f, 1));
var trackListFoldout = trackGroupInfo.Q<Foldout>("trackList");
#if RUKHANKA_DEBUG_INFO
var tgDebugInfo = ts.trackGroupDebugInfo[i];
trackListFoldout.text = $"[{i} {tgDebugInfo.name} Hash: {tgDebugInfo.hash:X}] Track Group Start:Length [{tgRange.x}:{tgRange.y - tgRange.x}]";
#else
trackListFoldout.text = $"[{i}] Track Group Start:Length [{tgRange.x}:{tgRange.y - tgRange.x}]";
#endif
var trackInfoHeader = trackBlobInfoAsset.Instantiate();
trackListFoldout.Add(trackInfoHeader);
for (var l = tgRange.x; l < tgRange.y; ++l)
{
Track t = ts.tracks[l];
var trackInfo = trackBlobInfoAsset.Instantiate();
var hashLabel = trackInfo.Q<Label>("hashLabel");
var nameLabel = trackInfo.Q<Label>("nameLabel");
var bindingTypeLabel = trackInfo.Q<Label>("bindingTypeLabel");
var channelIndexLabel = trackInfo.Q<Label>("channelIndexLabel");
var keyFrameInfoLabel = trackInfo.Q<Label>("keyFrameInfoLabel");
#if RUKHANKA_DEBUG_INFO
nameLabel.text = $"{t.name.ToString()}";
#else
nameLabel.text = "-";
#endif
hashLabel.text = t.props.ToString("X");
bindingTypeLabel.text = t.bindingType.ToString();
channelIndexLabel.text = t.channelIndex.ToString();
keyFrameInfoLabel.text = $"Start:Length [{t.keyFrameRange.x}:{t.keyFrameRange.y}]";
trackListFoldout.Add(trackInfo);
}
trackSetInfoFoldout.Add(trackGroupInfo);
}
}
}
}
@@ -0,0 +1,24 @@
fileFormatVersion: 2
guid: 28a266621693c00469972be15f47a2d5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- m_ViewDataDictionary: {instanceID: 0}
- visualTreeAsset: {fileID: 9197481963319205126, guid: 547be161a75c99a418c17010dda0234c, type: 3}
- trackGroupBlobInfoAsset: {fileID: 9197481963319205126, guid: 07660a014a4d1f24abec619013960db9, type: 3}
- trackBlobInfoAsset: {fileID: 9197481963319205126, guid: 63bc41214c99e734aa5adc4a69340137, type: 3}
- animationEventInfoAsset: {fileID: 9197481963319205126, guid: d48924796ce90364db884e5b7593aa47, 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/AnimationClipBlobInfoWindow/AnimatorClipBlobInfoWindow.cs
uploadId: 897522
@@ -0,0 +1,5 @@
.custom-label {
font-size: 20px;
-unity-font-style: bold;
color: rgb(68, 138, 255);
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: a257fa72e71cbc9458084aa8141bc9e2
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/AnimationClipBlobInfoWindow/AnimatorClipBlobInfoWindow.uss
uploadId: 897522
@@ -0,0 +1,34 @@
<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="True">
<Style src="project://database/Packages/com.rukhanka.animation/Rukhanka.Editor/BlobInspector/AnimationClipBlobInfoWindow/AnimatorClipBlobInfoWindow.uss?fileID=7433441132597879392&amp;guid=a257fa72e71cbc9458084aa8141bc9e2&amp;type=3#AnimatorClipBlobInfoWindow" />
<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; flex-shrink: 1;">
<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="Length:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
<ui:Label tabindex="-1" text="Cycle Offset:" parse-escape-sequences="true" display-tooltip-when-elided="true" />
<ui:Label tabindex="-1" text="Looped:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="true" />
<ui:Label tabindex="-1" text="Loop Pose Blend:" parse-escape-sequences="true" display-tooltip-when-elided="true" enable-rich-text="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="LabelLabelLabelLabelLabelLabelLabelLabelLabel" 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="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="lengthLabel" />
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="cycleOffsetLabel" />
<ui:Toggle focusable="false" name="loopedCheckBox" style="margin-top: 0; margin-bottom: 0; margin-right: 0; margin-left: 0;" />
<ui:Toggle focusable="false" name="loopPoseBlendCheckBox" style="visibility: visible; display: flex; margin-top: 0; margin-bottom: 0; margin-right: 0; margin-left: 0;" />
<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;">
<ui:Foldout text="Foldout" name="clipTracksInfoFoldout" value="false" style="align-items: stretch;" />
<ui:Foldout text="Foldout" value="false" name="additiveRefPoseTrackSetInfoFoldout" />
<ui:Foldout text="Foldout" value="false" name="animationEventsInfoFoldout" />
</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>
@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: 547be161a75c99a418c17010dda0234c
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/AnimationClipBlobInfoWindow/AnimatorClipBlobInfoWindow.uxml
uploadId: 897522
@@ -0,0 +1,9 @@
<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="True">
<ui:VisualElement style="flex-grow: 1; flex-direction: row;">
<ui:Label tabindex="-1" text="Hash (properties)" parse-escape-sequences="true" display-tooltip-when-elided="true" name="hashLabel" style="flex-grow: 0; border-right-color: rgb(127, 127, 127); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; align-self: auto; width: 282px;" />
<ui:Label tabindex="-1" text="Name" parse-escape-sequences="true" display-tooltip-when-elided="true" name="nameLabel" 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-right-width: 1px; width: 260px;" />
<ui:Label tabindex="-1" text="Binding Type" parse-escape-sequences="true" display-tooltip-when-elided="true" name="bindingTypeLabel" style="flex-grow: 0; align-self: auto; width: 210px; 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-right-width: 1px;" />
<ui:Label tabindex="-1" text="Channel Index" parse-escape-sequences="true" display-tooltip-when-elided="true" name="channelIndexLabel" style="flex-grow: 0; align-self: auto; width: 210px; 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);" />
<ui:Label tabindex="-1" text="KeyFrame Info" parse-escape-sequences="true" display-tooltip-when-elided="true" name="keyFrameInfoLabel" style="flex-grow: 0; align-self: auto; width: 210px;" />
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: 63bc41214c99e734aa5adc4a69340137
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/AnimationClipBlobInfoWindow/TrackBlobInfo.uxml
uploadId: 897522
@@ -0,0 +1,3 @@
<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="True">
<ui:Foldout text="Foldout" name="trackList" value="false" />
</ui:UXML>
@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: 07660a014a4d1f24abec619013960db9
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/AnimationClipBlobInfoWindow/TrackGroupBlobInfo.uxml
uploadId: 897522