public override void Execute() { CloudData data = CloudUpdater.instance.LoadCurrentStatus(); if (trajectorymodeON == false) { //UIManager.instance.DeactivateSelectionButtons(); TrajectoryUIContainer.SetActive(true); CloudUpdater.instance.DisplayTrajectories(); TrajectoriesRenderer = data.trajectoryObject.GetComponent <MeshRenderer>(); PointsRenderer = data.GetComponent <MeshRenderer>(); TimeList = data.globalMetaData.timeList; currentTimeIndex = 0; frameSlider.minValue = 0f; frameSlider.maxValue = TimeList.Count - 1; frameSlider.value = 0f; CloudUpdater.instance.SetShaderFrame(0f, 1f); trajectorymodeON = true; } else { TrajectoryUIContainer.SetActive(false); //UIManager.instance.ActivateSelectionButtons(); CloudUpdater.instance.HideTrajectories(); playAnimation = false; trajectorymodeON = false; } }
public override void Execute() { data = CloudUpdater.instance.LoadCurrentStatus(); if (trajectorymodeON == false) { UIManager.instance.DeactivateSelectionButtons(); PointsRenderer = data.GetComponent <MeshRenderer>(); TimeList = data.globalMetaData.timeList; currentTimeIndex = 0; frameSlider.minValue = 0f; frameSlider.maxValue = TimeList.Count - 1; frameSlider.value = 0f; trajectorymodeON = true; } else { UIManager.instance.ActivateSelectionButtons(); data.globalMetaData.tMaxThreshold = TimeList.Count - 1; CloudUpdater.instance.ChangeThreshold(); playAnimation = false; trajectorymodeON = false; } }
private void LoadCloudMesh(CloudData root, Vector3[] vertices, int[] indices, Vector2[] uv1Array, Vector2[] uv2Array, Vector2[] uv3Array) { Material material = new Material(Shader.Find("ViSP/Sprite Shader")); material.SetTexture("_SpriteTex", _sprite_texture); material.SetTexture("_ColorTex", ColorMapManager.instance.GetColorMap("autumn").texture); material.SetFloat("UpperTimeLimit", root.globalMetaData.upperframeLimit); material.SetFloat("LowerTimeLimit", root.globalMetaData.lowerframeLimit); root.gameObject.GetComponent <MeshRenderer>().material = material; Mesh mesh = new Mesh(); mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32; mesh.vertices = vertices; mesh.uv2 = uv1Array; // colorID, pointID mesh.uv3 = uv2Array; // isSelected, isHidden //mesh.uv4 = uv3Array; // trajectoryID, frame mesh.SetIndices(indices, MeshTopology.Points, 0); root.GetComponent <MeshFilter>().mesh = mesh; Debug.Log(indices.Length + " points loaded into cloudData"); Debug.Log(vertices.Length + " vertices"); }