Esempio n. 1
0
    static MainThreadProcessor()
    {
        var name = typeof(MainThreadProcessor).Name;

        Instance       = new GameObject(name).AddComponent <MainThreadProcessor>();
        Instance.Queue = new Queue <AsyncThreadCallback>();
    }
Esempio n. 2
0
    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));
    }
Esempio n. 3
0
    //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));
    }
Esempio n. 4
0
    public void processMessage(byte[] text)
    {
        if (text == null || text.Length == 0)
        {
            return;
        }
        //   Debug.Log(">> " +BitConverter.ToString(text));

        MainThreadProcessor.Instance().Enqueue(MainThreadProcessor.Instance().processMessage(text));
    }
Esempio n. 5
0
    //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);
     }
 }
Esempio n. 7
0
 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);
     }
 }