using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; namespace uc { public class ActivityQueueNetworkManager : NetworkManagerControl { [Header("Activity Queue")] public ActivityQueueManager queueManager = null; void SharedUpdate() { if (queueManager == null) { queueManager = FindObjectOfType(); } } protected override void ClientUpdate() { //print("ClientUpdate"); SharedUpdate(); if (queueManager) { var identity = GetLocalPlayer(); if (identity != null) { var an = identity.GetComponent(); queueManager.SetActivityByIndex(an.QueueIndex); } } } protected override void ServerUpdate() { //print("ServerUpdate"); SharedUpdate(); if (queueManager) { foreach (var id in NetworkServer.objects.Keys) { var identity = NetworkServer.objects[id]; var an = identity.GetComponent(); an.QueueIndex = queueManager.CurrentIndex; } } } } }