M1: add networked rigged player avatar (run-around character)

- Import Hodaart Low Poly Character Collection 3 (humanoid-rigged, LFS)
- PlayerAvatar.cs: owner-authoritative CharacterController movement, animation
  derived from measured speed on every client (no NetworkAnimator needed)
- OwnerAuthNetworkTransform.cs: owner-authoritative NetworkTransform
- PlayerLocomotion.controller: Idle/Walk/Run 1D blend tree on Speed (reuses
  Hodaart clips)
- PlayerCharacter.prefab (Character 01 + CC + NetworkObject + owner NT +
  PlayerAvatar + Animator w/ humanoid avatar); registered as PlayerPrefab
- Verified in play: spawns, visible, Idle pose (rig animates), owner-auth

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-07-12 18:43:39 +01:00
parent 5db61fdb57
commit 94951ec70a
141 changed files with 287727 additions and 1 deletions

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 832fafa606ab4ad40a80a38b1aafd3f6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,102 @@
using System.IO;
using UnityEditor;
namespace Hodaart.LowPolyCharacterCollection3.Editor
{
/// <summary>
/// Checks whether the Input System package is installed and informs the user
/// if it is required by this asset.
/// </summary>
[InitializeOnLoad]
internal static class HodaartDependencyInstaller
{
private const string PackageId = "com.unity.inputsystem";
private const string ActiveInputHandlerKey = "activeInputHandler:";
private const string EditorPrefKey =
"Hodaart.LowPolyCharacterCollection3.DependencyChecked";
static HodaartDependencyInstaller()
{
// Only run once per project
if (EditorPrefs.GetBool(EditorPrefKey, false))
return;
EditorPrefs.SetBool(EditorPrefKey, true);
if (!IsInManifest(PackageId))
{
ShowInstallMessage();
return;
}
PromptInputHandlingIfNeeded();
}
private static bool IsInManifest(string packageId)
{
string path = Path.GetFullPath("Packages/manifest.json");
if (!File.Exists(path))
return false;
return File.ReadAllText(path).Contains($"\"{packageId}\"");
}
private static void ShowInstallMessage()
{
bool open = EditorUtility.DisplayDialog(
"Input System Required",
"This asset requires Unity's Input System package.\n\n" +
"Please install it using:\n\n" +
"Window → Package Manager\n" +
"→ Unity Registry\n" +
"→ Input System\n\n" +
"After installation, restart Unity if requested.",
"Open Package Manager",
"Later");
if (open)
EditorApplication.ExecuteMenuItem("Window/Package Manager");
}
private static void PromptInputHandlingIfNeeded()
{
if (!IsUsingOldInputManagerOnly())
return;
bool open = EditorUtility.DisplayDialog(
"Input System Detected",
"The Input System package is installed.\n\n" +
"Your project is still using the old Input Manager.\n\n" +
"For this asset to work correctly, set Active Input Handling to:\n\n" +
"• Both\nor\n• Input System Package (New)",
"Open Project Settings",
"Later");
if (open)
SettingsService.OpenProjectSettings("Project/Player");
}
private static bool IsUsingOldInputManagerOnly()
{
string path = Path.GetFullPath("ProjectSettings/ProjectSettings.asset");
if (!File.Exists(path))
return false;
foreach (string line in File.ReadAllLines(path))
{
string trimmed = line.Trim();
if (!trimmed.StartsWith(ActiveInputHandlerKey))
continue;
string value = trimmed.Substring(ActiveInputHandlerKey.Length).Trim();
return value == "0";
}
return false;
}
}
}

View file

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 493ff93757642094fa18618ddf98e1bd
AssetOrigin:
serializedVersion: 1
productId: 388758
packageName: Low Poly Character Collection 3
packageVersion: 1.1
assetPath: Assets/Hodaart/HodaartLowPolyCharacterCollection3/Scripts/Editor/HodaartDependencyInstaller.cs
uploadId: 946460