private void Start() { instance = this; TagNodeCompound levelDat = NBTHelper.GetLevelDat(); TagNodeLong dayTimeNode = levelDat["DayTime"] as TagNodeLong; int dayTime = (int)dayTimeNode.Data; tick = dayTime; }
// Use this for initialization void Start() { Physics.queriesHitBackfaces = true; Cursor.lockState = CursorLockMode.Locked; camera = transform.Find("camera"); vcamWide = camera.Find("vcam_wide").gameObject; cc = GetComponent <CharacterController>(); handCam = Camera.main.transform.Find("Camera").GetComponent <Camera>(); handAnimator = Camera.main.transform.Find("hand").GetComponent <Animator>(); m_HeadBob.Setup(camera, 5); TagNodeCompound levelDat = NBTHelper.GetLevelDat(); TagNodeCompound player = levelDat["Player"] as TagNodeCompound; TagNodeCompound abilities = player["abilities"] as TagNodeCompound; TagNodeByte flying = abilities["flying"] as TagNodeByte; isFlying = flying == 1 ? true : false; transform.position = DataCenter.spawnPosition; transform.localEulerAngles = new Vector3(0, -DataCenter.spawnRotation.y, 0); camera.transform.localEulerAngles = new Vector3(DataCenter.spawnRotation.z, 0, 0); //NetworkManager.Register(ENUM_CMD.CS_ADD_BLOCK_NOTIFY, OnAddBlockNotify); //NetworkManager.Register(ENUM_CMD.CS_DELETE_BLOCK_NOTIFY, OnDeleteBlockNotify); LoadingUI.Close(); CrossHair.Show(); Hand.Show(); blockMeshFilter = Camera.main.transform.Find("hand/block").GetComponent <MeshFilter>(); blockMeshRenderer = Camera.main.transform.Find("hand/block").GetComponent <MeshRenderer>(); handMeshRenderer = Camera.main.transform.Find("hand").GetComponent <MeshRenderer>(); position = transform.position; forward = transform.forward; isInitialized = true; }