private void Start() { world = FindObjectOfType <VoxelWorldInterface>(); player = GameObject.FindGameObjectsWithTag("Player")[0].transform; List <DebugItem> items = new List <DebugItem>() { new DebugItem("FPS"), new DebugItem("Coords"), new DebugItem("ChunkID"), new DebugItem("LookingAtLightLevel"), new DebugItem("WaitingForUpdateCheck"), new DebugItem("Pipeline Status") }; foreach (var item in items) { var display = Instantiate(textPrefab, transform).GetComponent <Text>(); display.fontSize = fontSize; item.display = display; item.Apply(); debugItems.Add(item.name, item); } SetVisibility(false); }
private void Start() { WorldInterface = FindObjectOfType <VoxelWorldInterface>(); Assert.IsNotNull(WorldInterface, "A BlockPlacer must have a reference to a VoxelWorldInterface to operate"); UImanager = FindObjectOfType <UIManager>(); Assert.IsNotNull(UImanager, "Block placer could not find a UI manager"); Indicator = Instantiate(IndicatorPrefab); Indicator.transform.parent = transform; Indicator.transform.position = transform.position; Indicator.SetActive(false); //Ensure the indicator is rendered after other transparent materials Indicator.GetComponent <MeshRenderer>().material.renderQueue++; }