NewN_UAVPlane/Assets/Zion/Scripts/Adam/Utility/Sync/AsyncObjectBase.cs

52 lines
1.5 KiB
C#

using HighlightingSystem;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
using UnityTemplateProjects;
namespace AdamSync
{
public class AsyncObjectBase : MonoBehaviour
{
public ulong userID;
public string userName;
public ulong roomID;
public bool isPlayer = false;
public Animation selfAnimation;
public Camera selfCamera;
public RectTransform rect;
void Start()
{
}
protected string GetSyncData()
{
return string.Format("{0};{1},{2},{3};{4},{5},{6}", userID, transform.position.x, transform.position.y, transform.position.z, transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z);
}
public void SetPlayerInfo(ulong _userID, string _userName, ulong _roomID, bool _isPlayer)
{
userID = _userID;
userName = _userName;
roomID = _roomID;
isPlayer = _isPlayer;
if (!_isPlayer)
{
Destroy(gameObject.GetComponent<HighlightingRenderer>());
Destroy(gameObject.GetComponent<SimpleCameraController>());
Destroy(gameObject.GetComponent<PostProcessLayer>());
Destroy(gameObject.GetComponent<AudioListener>());
Destroy(gameObject.GetComponent<Camera>());
}
else
{
gameObject.tag = "MainCamera";
}
}
}
}