Ejemplo n.º 1
0
 // Use this for initialization
 void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
     else
     {
         return;
     }
 }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     if (InitMe.GetInstance().EnableVR)
     {
         camera = GameObject.Find("Camera (eye)");
     }
     else
     {
         camera = GameObject.Find("Camera");
     }
     if (camera == null)
     {
         Debug.Log("Can't find camera");
     }
 }
 // Use this for initialization
 void Start()
 {
     if (InitMe.GetInstance().EnableVR)
     {
         camera = GameObject.Find("Camera (eye)");
     }
     else
     {
         camera = GameObject.Find("Camera");
     }
     if (camera == null)
     {
         Debug.Log("Can't find camera");
     }
     holoRoot    = GameObject.Find("HoloRoot");
     actualScale = holoRoot.transform.localScale;
 }
Ejemplo n.º 4
0
        protected void InitializePlayer(byte type, List <byte> data)
        {
            Logger.Write($"INITIALIZE PLAYER TYPE:{type}");
            if (_me != null)
            {
                return;             //already initialized.
            }
            byte[] packet = data.ToArray();
            UInt32 id     = BitConverter.ToUInt32(packet, 1);

            Globals.CharacterClassType charClass = (Globals.CharacterClassType)data[5];
            String name      = BitConverter.ToString(packet, 6, 15);
            UInt16 x         = BitConverter.ToUInt16(packet, 22);
            UInt16 y         = BitConverter.ToUInt16(packet, 24);
            Player newPlayer = new Player(name, id, charClass, _level, x, y);

            Logger.Write($"INITIALIZE PLAYER ID:{id}");
            _me = newPlayer;
            InitMe?.Invoke(_me);
        }