Example #1
0
        public void ChangeMatricies(Transform newParent)
        {
//			Debug.Log("Not changing matrices as it f***s up move");
//			return;
            if (isServer)
            {
                NetworkIdentity netIdent = newParent.GetComponent <NetworkIdentity>();
                if (registerTile.ParentNetId != netIdent.netId)
                {
                    registerTile.ParentNetId = netIdent.netId;
                    playerSync.SetPosition(transform.localPosition);
                }
            }
            else
            {
                registerTile.SetParentOnLocal(newParent);
            }
            Camera.main.transform.parent = newParent;
            Debug.Log("Change Matricies");
        }