static MainThreadProcessor() { var name = typeof(MainThreadProcessor).Name; Instance = new GameObject(name).AddComponent <MainThreadProcessor>(); Instance.Queue = new Queue <AsyncThreadCallback>(); }
public void processMessage(byte[] text, System.Net.IPEndPoint ip) { if (text == null || text.Length == 0) { return; } Debug.Log(">> " + text); MainThreadProcessor.Instance().Enqueue(MainThreadProcessor.Instance().processMessage(text, ip)); }
//protected UDPServer udpServer; //public virtual void setUdpServer(UDPServer server) //{ // this.udpServer = server; //} public void processMessage(string text) { if (text == null || text.Length == 0) { return; } Debug.Log(">> " + text); MainThreadProcessor.Instance().Enqueue(MainThreadProcessor.Instance().processMessage(text)); }
public void processMessage(byte[] text) { if (text == null || text.Length == 0) { return; } // Debug.Log(">> " +BitConverter.ToString(text)); MainThreadProcessor.Instance().Enqueue(MainThreadProcessor.Instance().processMessage(text)); }
//private UnityEngine.AI.NavMeshPath path; // Use this for initialization void Start() { Transform model = transform.Find("Model"); anim = model.GetComponent <Animator>(); agent = GetComponent <UnityEngine.AI.NavMeshAgent>(); agent.speed = MovementSpeed; line = GetComponent <LineRenderer>(); //path = new UnityEngine.AI.NavMeshPath(); GameLogic.playersPool [id] = gameObject; udpClient = MainThreadProcessor.Instance().GetComponent <UDPClient> (); cone = GameObject.Instantiate(conePrefab, transform.position, conePrefab.transform.rotation); }
void Awake() { if (_instance == null) { _instance = this; clientStrategy = GetComponent <IUIHandler>(); if (clientStrategy == null) { Application.Quit(); throw new Exception("Please add a client strategy that inherits from IUIHandler for UI updates references."); } //inputManager = GetComponent<InputManager>(); DontDestroyOnLoad(this.gameObject); } }
public void init() { if (_instance == null) { _instance = gameObject.GetComponent <MainThreadProcessor>(); clientStrategy = GetComponent <IUIHandler>(); if (clientStrategy == null) { Application.Quit(); throw new Exception("Plsss"); } //inputManager = GetComponent<InputManager>(); //DontDestroyOnLoad(this.gameObject); } }