Skip to content

Commit

Permalink
0.1.69 - Add inactive prefab to the scene from RepeatView to make it …
Browse files Browse the repository at this point in the history
…easier to edit
  • Loading branch information
neilsarkar committed Aug 11, 2020
1 parent ecd9188 commit 88f89b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Runtime/Views/RepeatView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
using System.Collections.Generic;
using Dispatch;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif

namespace VioletUI {
public abstract class RepeatView<TState, T> : View<TState> where TState : class, IState {
Expand Down Expand Up @@ -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
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 88f89b6

Please sign in to comment.