private void HideHeader() { var moveAnimation = new ThicknessAnimation(new Thickness(0, -60, 0, 0), TimeSpan.FromSeconds(0.25)); HeaderGrid.BeginAnimation(Grid.MarginProperty, moveAnimation); var fadeInAnimation = new DoubleAnimation(1, TimeSpan.FromSeconds(0.25)); TrianglePoly.BeginAnimation(Polygon.OpacityProperty, fadeInAnimation); }
private void ShowHeader() { var moveAnimation = new ThicknessAnimation(new Thickness(0, 30, 0, 0), TimeSpan.FromSeconds(0.25)); HeaderGrid.BeginAnimation(MarginProperty, moveAnimation); moveAnimation = new ThicknessAnimation(new Thickness(0, 130, ChatGrid.Margin.Right, 30), TimeSpan.FromSeconds(0.25)); ChatGrid.BeginAnimation(MarginProperty, moveAnimation); var fadeOutAnimation = new DoubleAnimation(0, TimeSpan.FromSeconds(0.25)); TrianglePoly.BeginAnimation(OpacityProperty, fadeOutAnimation); }
//Generates a mesh based on stored vertex information //It also modifies each vertex color information and uv coordinates private Mesh GenerateMesh(List <TrianglePoly> piecePoly) { Mesh mesh = new Mesh(); int vertexesCount = piecePoly.Count * 3; int[] indies = new int[vertexesCount]; Vector3[] vertexes = new Vector3[vertexesCount]; Vector3[] normals = new Vector3[vertexesCount]; Color32[] colors = new Color32[vertexesCount]; Color32 groundColor = Color32.Lerp(color1, color2, Random.Range(0f, 1f)); for (int i = 0; i < piecePoly.Count; i++) { TrianglePoly tri = piecePoly[i]; indies[i * 3 + 0] = i * 3 + 0; indies[i * 3 + 1] = i * 3 + 1; indies[i * 3 + 2] = i * 3 + 2; vertexes[i * 3 + 0] = base.vertexes[tri.triA]; vertexes[i * 3 + 1] = base.vertexes[tri.triB]; vertexes[i * 3 + 2] = base.vertexes[tri.triC]; normals[i * 3 + 0] = base.vertexes[tri.triA]; normals[i * 3 + 1] = base.vertexes[tri.triB]; normals[i * 3 + 2] = base.vertexes[tri.triC]; colors[i * 3 + 0] = groundColor; colors[i * 3 + 1] = groundColor; colors[i * 3 + 2] = groundColor; } mesh.vertices = vertexes; mesh.normals = normals; mesh.colors32 = colors; Vector2[] uv = CreateUV(vertexes); mesh.uv = uv; mesh.SetTriangles(indies, 0); return(mesh); }