// Use this for initialization void Start() { generated = false; coroutineLimiter = GameObject.Find("CoroutineLimiter").GetComponent <CoroutineLimiter>(); BC = gameObject.GetComponent <BoxCollider>(); parent = gameObject.transform.parent; localCenterPoint = gameObject.transform.localPosition + BC.center; meshSquareSize = BC.size; localScale = gameObject.transform.localScale; raycastSquareSize = new Vector3(BC.size.x * localScale.x * 1.5f, BC.size.y * localScale.y * 1.5f, BC.size.z * localScale.z * 1.5f); origin = new Vector3((localCenterPoint.x - (meshSquareSize.x / 2)) * localScale.x + (blockSize / 2), (localCenterPoint.y - (meshSquareSize.y / 2)) * localScale.y + (blockSize / 2), (localCenterPoint.z - (meshSquareSize.z / 2)) * localScale.z + (blockSize / 2)); if (useOffsetPoint) { originOffset.x = (blockSize - ((OffsetPoint.transform.localPosition.x - origin.x) % blockSize)); originOffset.y = (blockSize - ((OffsetPoint.transform.localPosition.y - origin.y) % blockSize)); originOffset.z = (blockSize - ((OffsetPoint.transform.localPosition.z - origin.z) % blockSize)); origin += originOffset; } pointList = new List <GameObject>(); attachedVertex = 0; voxelConstructionEstimation = 0; BC.enabled = false; gameObject.GetComponent <MeshCollider>().enabled = true; VoxelList = GameObject.Find("VoxelList"); if (VoxelList == null) { VoxelList = new GameObject("VoxelList"); } AnchorList = new GameObject("AnchorList"); AnchorList.transform.parent = parent; AnchorList.transform.position = parent.transform.position; AnchorList.transform.rotation = parent.transform.rotation; anchoredVoxelNBR = 0; if (deadEnd != null) { deadEnd.name = "DeadEnd"; } if (instantiateVoxel && fading) { gameObject.GetComponent <MeshRenderer>().enabled = true; } StartCoroutine("InstantiateBlock"); }
// Use this for initialization void Start() { coroutineLimiter = GameObject.Find("CoroutineLimiter").GetComponent <CoroutineLimiter>(); }