-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
6 changed files
with
51 additions
and
24 deletions.
There are no files selected for viewing
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
40 changes: 40 additions & 0 deletions
40
Packages/RosettaUI/Runtime/Elements/ElementGroup/WindowElement.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,40 @@ | ||
using System.Collections.Generic; | ||
using RosettaUI.Reactive; | ||
using UnityEngine; | ||
using UnityEngine.Assertions; | ||
|
||
namespace RosettaUI | ||
{ | ||
public class WindowElement : OpenCloseBaseElement | ||
{ | ||
public readonly ReactiveProperty<Vector2?> positionRx = new(); | ||
|
||
private bool _closable = true; | ||
|
||
public Vector2? Position | ||
{ | ||
set => positionRx.Value = value; | ||
} | ||
|
||
public bool Closable | ||
{ | ||
get => _closable; | ||
set | ||
{ | ||
if (_closable == value) return; | ||
if (HasBuilt) | ||
{ | ||
Debug.LogWarning($"{nameof(WindowElement)}.{nameof(Closable)} is not applied after {nameof(RosettaUIRoot)}.{nameof(RosettaUIRoot.Build)}()."); | ||
} | ||
|
||
_closable = value; | ||
} | ||
} | ||
|
||
public override ReactiveProperty<bool> IsOpenRx => enableRx; | ||
|
||
public WindowElement(Element header, IEnumerable<Element> contents) : base(header, contents) | ||
{ | ||
} | ||
} | ||
} |
File renamed without changes.
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 was deleted.
Oops, something went wrong.