- 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>
28 lines
No EOL
915 B
C#
28 lines
No EOL
915 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
#if ENABLE_INPUT_SYSTEM
|
|
using UnityEngine.InputSystem.UI;
|
|
#endif
|
|
|
|
namespace LowPolyCharacterCollection3
|
|
{
|
|
[DisallowMultipleComponent]
|
|
public class EventSystemEnsurer : MonoBehaviour
|
|
{
|
|
private void Awake()
|
|
{
|
|
if (FindObjectOfType<EventSystem>() == null)
|
|
{
|
|
var go = new GameObject("EventSystem");
|
|
go.AddComponent<EventSystem>();
|
|
#if ENABLE_INPUT_SYSTEM && !ENABLE_LEGACY_INPUT_MANAGER
|
|
go.AddComponent<InputSystemUIInputModule>();
|
|
Debug.Log("[EventSystemEnsurer] No EventSystem found — created one with InputSystemUIInputModule.");
|
|
#else
|
|
go.AddComponent<StandaloneInputModule>();
|
|
Debug.Log("[EventSystemEnsurer] No EventSystem found — created one with StandaloneInputModule.");
|
|
#endif
|
|
}
|
|
}
|
|
}
|
|
} |