Added PlayerMovement and other

This commit is contained in:
2026-06-20 16:32:20 +03:00
parent f5c79c7241
commit eca9be620a
25 changed files with 3630 additions and 2200 deletions
@@ -0,0 +1,51 @@
using UnityEngine;
using Unity.Netcode;
using System.Collections;
public class PlayerFacade : NetworkBehaviour
{
// [SerializeField] private PlayerController playerController;
[SerializeField] private PlayerMovement playerMovement;
[SerializeField] private PlayerHealth playerHealth;
[SerializeField] private PlayerShoot playerShoot;
[SerializeField] private PlayerUIController playerUIController;
public PlayerHealth PlayerHealth => playerHealth;
public override void OnNetworkSpawn()
{
if(IsOwner)
{
StartCoroutine(InitPlayerUIController());
if(playerMovement != null)
{
playerMovement.Init();
}
if(playerShoot != null)
{
playerShoot.Init();
}
}
if(playerHealth != null)
{
playerHealth.Init(IsServer);
}
}
private IEnumerator InitPlayerUIController()
{
yield return new WaitUntil(() =>
{
playerUIController = FindFirstObjectByType<PlayerUIController>();
return playerUIController != null;
});
if(playerUIController != null)
{
playerUIController.Init(this);
}
}
}