-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
267 additions
and
142 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
Assets/SmartAddresser/Editor/Core/Models/LayoutRules/BaseLayoutRuleData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace SmartAddresser.Editor.Core.Models.LayoutRules | ||
{ | ||
public abstract class BaseLayoutRuleData : ScriptableObject | ||
{ | ||
public abstract IEnumerable<LayoutRule> LayoutRules { get; } | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Assets/SmartAddresser/Editor/Core/Models/LayoutRules/BaseLayoutRuleData.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
Assets/SmartAddresser/Editor/Core/Models/LayoutRules/CompositeLayoutRuleData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
namespace SmartAddresser.Editor.Core.Models.LayoutRules | ||
{ | ||
[CreateAssetMenu(fileName = "CompositeLayoutRuleData", menuName = "Smart Addresser/Composite Layout Rule Data")] | ||
public sealed class CompositeLayoutRuleData : BaseLayoutRuleData | ||
{ | ||
[SerializeField] private LayoutRuleData[] _layoutRules; | ||
|
||
public override IEnumerable<LayoutRule> LayoutRules => _layoutRules.SelectMany(x => x.LayoutRules); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Assets/SmartAddresser/Editor/Core/Models/LayoutRules/CompositeLayoutRuleData.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
Assets/SmartAddresser/Editor/Core/Models/LayoutRules/CompositeLayoutRuleDataEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using SmartAddresser.Editor.Core.Tools.Shared; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace SmartAddresser.Editor.Core.Models.LayoutRules | ||
{ | ||
[CustomEditor(typeof(CompositeLayoutRuleData))] | ||
internal sealed class CompositeLayoutRuleDataEditor : UnityEditor.Editor | ||
{ | ||
public override void OnInspectorGUI() | ||
{ | ||
var data = (CompositeLayoutRuleData)target; | ||
|
||
if (GUILayout.Button("Apply")) | ||
MenuActions.ApplyAction(data); | ||
|
||
GUI.enabled = false; | ||
base.OnInspectorGUI(); | ||
GUI.enabled = true; | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Assets/SmartAddresser/Editor/Core/Models/LayoutRules/CompositeLayoutRuleDataEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.