提交Unity 联机Pro

This commit is contained in:
PC-20230316NUNE\Administrator
2024-08-17 14:27:18 +08:00
parent f00193b000
commit 894100ae37
7448 changed files with 854473 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
using System;
using AppGame;
using Game.Input;
using JNGame.Math;
using Plugins.JNGame.Network;
using UnityEngine;
using UnityEngine.UI;
namespace UI
{
public class DMainUI : MonoBehaviour
{
public GameObject root;
public Text SizeText;
public Text ByteSizeText;
public Camera MainCamera;
private void Update()
{
SizeText.text = $"{root.transform.childCount}";
if (App.IsClient())
{
// ByteSizeText.text = $"{JNTCPClient.Size}";
}
if (App.IsServer())
{
ByteSizeText.text = $"{App.Server.GetByteSize()}";
}
if (!(App.IsClient())) return;
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
var transform1 = MainCamera.transform;
movement = transform1.forward * movement.z + transform1.right * movement.x;
movement = movement.normalized;
IDPlayerMoveVector vector = new IDPlayerMoveVector
{
X = movement.x.ToLFloat(),
Y = movement.z.ToLFloat(),
};
if (App.Game.IsStartGame)
{
Debug.Log($"{vector.X} {vector.Y}");
App.Game.GetInput<IDPlayer>().MoveVector = vector;
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 92f14f0fc9194cc3993c79ccce2bc7ee
timeCreated: 1722219215