added NetworkManager compontent

This commit is contained in:
DerTyp187
2021-10-20 07:53:44 +02:00
parent 0ce5bb61d6
commit c913fff83a
7 changed files with 312 additions and 225 deletions

View File

@@ -11,11 +11,19 @@ public class DebugCanvas : MonoBehaviour
public float deltaTime;
private void Update()
{
DebugTextGrounded.text = "isGrounded: " + Player.GetComponent<PlayerController>().isGrounded.ToString();
{/*
if(Player == null)
{
Player = GameObject.FindGameObjectWithTag("Player").gameObject;
}
else
{
DebugTextGrounded.text = "isGrounded: " + Player.GetComponent<PlayerController>().isGrounded.ToString();
deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
float fps = 1.0f / deltaTime;
fpsText.text = Mathf.Ceil(fps).ToString() + "FPS";
deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
float fps = 1.0f / deltaTime;
fpsText.text = Mathf.Ceil(fps).ToString() + "FPS";
}
*/
}
}

View File

@@ -0,0 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MLAPI;
public class Networking : NetworkManager
{
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f54db2e39d506634a9373c6d52305187
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -12,8 +12,10 @@ public class Player : MonoBehaviour
private void Start()
{
GameManager = GameObject.Find("GameManager");
playerMaster = GameManager.GetComponent<PlayerMaster>();
InvokeRepeating("Sync", 3.0f, SyncIntervalSeconds);
//InvokeRepeating("Sync", 3.0f, SyncIntervalSeconds);
}