public void startFading(bool on, float speed, VoxelGenerationBlock mesh) { voxelColor = gameObject.GetComponent <MeshRenderer>().material.GetColor("_Color"); voxelSColor = gameObject.GetComponent <MeshRenderer>().material.GetColor("_SColor"); meshColor = mesh.gameObject.GetComponent <MeshRenderer>().material.GetColor("_Color"); meshSColor = mesh.gameObject.GetComponent <MeshRenderer>().material.GetColor("_SColor"); StartCoroutine(fadeMaterial(on, speed)); }
public bool StartMeshDislocking(VoxelGenerationBlock VGB = null) { if (VGB != null) { voxelGenerator = VGB; } StartCoroutine(DislockMesh(voxelGenerator != null ? voxelGenerator.getListIterator(): 0)); return(true); }
public bool StartInstantiateBlock(VoxelGenerationBlock VGB = null) { if (VGB != null) { voxelGenerator = VGB; } if (voxelGenerator == null) { return(false); } StartCoroutine(InstantiateBlock(voxelGenerator.getListIterator())); return(true); }
private IEnumerator goToPlatform() { VoxelGenerationBlock VGB = platforme.GetComponentInChildren <VoxelGenerationBlock>(); while (platforme.transform.position.y < 2) { if (VGB.isFullVertex()) { float y = speed * Time.deltaTime; Vector3 move = new Vector3(0, y, 0); platforme.transform.position += move; player.transform.position += move; player.GetComponent <PlayerDollisionDetection>().controller.transform.position += move; } yield return(new WaitForFixedUpdate()); } player.GetComponent <PlayerDollisionDetection>().controller.GetComponent <FirstPersonController>().setWalkSpeed(5); player.GetComponent <PlayerDollisionDetection>().controller.GetComponent <FirstPersonController>().setRunSpeed(10); oldPlat = platforme; Invoke("deleteVGB", 2.0f); recuperation = false; yield return(0); }
public void Initialisation(VoxelGenerationBlock VGB = null, int iterator = -1) { voxelGenerator = VGB; this.iterator = iterator; }