From 88f89b62126e061e7ec8b4472c9e5a6aba5d4aa1 Mon Sep 17 00:00:00 2001 From: Neil Sarkar Date: Mon, 10 Aug 2020 18:09:42 -0700 Subject: [PATCH] 0.1.69 - Add inactive prefab to the scene from RepeatView to make it easier to edit --- CHANGELOG.md | 5 +++++ Runtime/Views/RepeatView.cs | 8 ++++++++ package.json | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78863c5..d4d4055 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.69] - 2020-08-10 + +### Changed +- RepeatView now adds an inactive prefab to the scene to make it easier to edit + ## [0.1.68] - 2020-08-10 ### Added diff --git a/Runtime/Views/RepeatView.cs b/Runtime/Views/RepeatView.cs index a580a18..5637210 100644 --- a/Runtime/Views/RepeatView.cs +++ b/Runtime/Views/RepeatView.cs @@ -2,6 +2,9 @@ using System.Collections.Generic; using Dispatch; using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif namespace VioletUI { public abstract class RepeatView : View where TState : class, IState { @@ -40,6 +43,11 @@ void RenderChildren() { if (view == null) {continue;} view.RenderInternal(State, default(TState)); } + +#if UNITY_EDITOR + var model = PrefabUtility.InstantiatePrefab(ViewPrefab, transform) as GameObject; + model.SetActive(false); +#endif } } } diff --git a/package.json b/package.json index 3384b0a..963875c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.neilsarkar.violetui", - "version": "0.1.68", + "version": "0.1.69", "displayName": "Violet UI", "description": "State-based rendering with live updates in the Unity Editor", "unity": "2019.4",