protected override void Load() { this.name = "Cafe Room"; floor = new GameObject("Floor"); walls = new GameObject("Walls"); floor.transform.SetParent(this.transform); walls.transform.SetParent(this.transform); //UnityUtils.CreateMesh(floor, "cafe_room", "cafe_floor", "cafe_floor_material"); //UnityUtils.CreateMesh(walls, "cafe_room", "cafe_walls", "cafe_wall_material"); tiles = new List <TileTuple>(); for (int i = 0; i < Model.Width - 1; i++) { for (int j = 0; j < Model.Height - 1; j++) { var tile = new GameObject("tile"); tile.transform.position = TurtleUtils.CafeSpaceToWorldCoordinates(new Vector2(i + 0.5f, j + 0.5f), 0.01f); tile.transform.SetParent(this.transform); UnityUtils.CreateMesh(tile, "quad", "quad", "default"); tile.transform.localScale = 0.1f * Vector3.one; tile.GetComponent <MeshRenderer>().material.color = Color.Lerp(Color.red, Color.white, 0.5f); tiles.Add(new TileTuple() { X = i, Y = j, Tile = tile }); } } }
protected override void Load() { child = new GameObject("Rainbow"); child.transform.SetParent(transform); UnityUtils.CreateImage(child, "test"); child.GetComponent <RectTransform>().pivot = new Vector2(0, 1); AnchoredVector2 a = new AnchoredVector2(TextAnchor.UpperLeft, new Vector2(Model.EdgePaddingPixels, Model.EdgePaddingPixels)); child.transform.localPosition = a.EvaluateWithRectangle(ViewportRect); }
protected override void Load() { UnityUtils.CreateMesh(gameObject, "mouseRay", "mouseRay", "Default-Diffuse"); }
protected override void Load() { UnityUtils.CreateCamera(this.gameObject); }