예제 #1
0
        private void UpdateCube(int x, int y, int z, int status)
        {
            CubeController cubeController = cubes[x, y, z].GetComponent <CubeController>();

            if (status == 1)
            {
                cubes[x, y, z].GetComponent <MeshRenderer>().enabled = true;
                cubeController.Activate();
            }
            else if (status == 0)
            {
                cubeController.Deactivate();
            }


            //			MeshRenderer cubeMesh = cubes[x,y,z].GetComponent<MeshRenderer>();
            //			cubeMesh.material.color = status == 1 ? Color.black : Color.white;


            //			if (status == 1) {
            //				cubes[x, y, z].gameObject.transform.localScale = Vector3.Lerp(
            //					cubes[x, y, z].gameObject.transform.localScale,
            //					new Vector3(.5f, .5f, .5f),
            //					.5f
            //				);
            //			} else {
            //				cubes[x, y, z].gameObject.transform.localScale = Vector3.Lerp(
            //					cubes[x, y, z].gameObject.transform.localScale,
            //					new Vector3(0f, 0f, 0f),
            //					.5f
            //				);
            //			}
        }