Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.junie
.junie

Builds
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Add the following components to the **same GameObject** as `OpenCreatorRailsServ
| `EmbeddedWalletProvider` | `Chain Id` | Or implement `IWalletProvider` |
| `PollingEventHandler` | *(none)* | Or implement `IEventHandler` |

> `EmbeddedWalletProvider` reads wallet credentials from `Assets/secrets.json`. Create that file with:
> `EmbeddedWalletProvider` reads wallet credentials from `Assets/StreamingAssets/secrets.json`. Create that file with:
>
> ```json
> {
Expand Down Expand Up @@ -89,7 +89,7 @@ using Io.ChainSafe.OpenCreatorRails;
using Cysharp.Threading.Tasks;

// Connect the default account (index 0).
// EmbeddedWalletProvider reads credentials from Assets/secrets.json.
// EmbeddedWalletProvider reads credentials from Assets/StreamingAssets/secrets.json.
await OpenCreatorRailsService.Instance.Connect();

// Connect a different HD account (e.g. account at derivation index 2)
Expand Down
4 changes: 2 additions & 2 deletions SampleProject/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ InitTestScene*.unity*
/[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity*

# Secrets file
secrets.json
secrets.json.meta
/[Aa]ssets/StreamingAssets/secrets.json
/[Aa]ssets/StreamingAssets/secrets.json.meta
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: cd76cd16673940718cb2ba938d239061, type: 3}
m_Name:
m_EditorClassIdentifier: io.chainsafe.open-creator-rails::Io.ChainSafe.OpenCreatorRails.OpenCreatorRailsService
_dontDestroyOnLoad: 1
_dontDestroyOnLoad: 0
_assets: []
--- !u!114 &462771278
MonoBehaviour:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
<ui:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/Samples/Open%20Creator%20Rails%20Unity/0.1.0/Open%20Creator%20Rails%20Sample/UI/Styles.uss?fileID=7433441132597879392&amp;guid=13347270707df7b9e890b1552844e38c&amp;type=3#Styles"/>
<ui:VisualElement data-source-path="" data-source-type="Io.ChainSafe.OpenCreatorRails.Samples.AccessGrantedModel, Assembly-CSharp" style="flex-grow: 1; position: absolute; top: 20%; bottom: 20%; height: 60%; width: 40%; align-self: center; align-content: center; align-items: center; justify-content: center; background-color: rgb(255, 255, 255); border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px; margin-top: 0; padding-top: 10px; padding-bottom: 10px;">
<ui:VisualElement name="VisualElement" style="flex-grow: 0; aspect-ratio: 1; border-top-left-radius: 50px; border-top-right-radius: 50px; border-bottom-right-radius: 50px; border-bottom-left-radius: 50px; background-color: rgb(30, 27, 75); top: 1%; padding-top: 0; padding-bottom: 0; width: auto; left: auto; right: auto; height: 20%; position: relative; bottom: 80%;">
<ui:VisualElement name="VisualElement" style="flex-grow: 0; aspect-ratio: 1; border-top-left-radius: 100px; border-top-right-radius: 100px; border-bottom-right-radius: 100px; border-bottom-left-radius: 100px; background-color: rgb(30, 27, 75); top: 1%; padding-top: 0; padding-bottom: 0; width: auto; left: auto; right: auto; height: 20%; position: relative; bottom: 80%;">
<ui:VisualElement style="flex-grow: 1; position: absolute; top: 25%; bottom: 25%; left: 25%; right: 25%; background-color: rgb(255, 255, 255); border-top-left-radius: 50px; border-top-right-radius: 50px; border-bottom-right-radius: 50px; border-bottom-left-radius: 50px;">
<ui:Image source="project://database/Assets/UI%20Toolkit/UnityThemes/UnityDefaultRuntimeTheme.tss?fileID=7433338533053954386&amp;guid=2da9829c311e5f08e97a397d1d77526d&amp;type=3#check@2x" tint-color="rgb(30, 27, 75)" style="flex-grow: 1;"/>
</ui:VisualElement>
</ui:VisualElement>
<ui:Label text="Access Granted" style="-unity-font-style: bold; font-size: 24px;"/>
<ui:Label text="Your membership is now active. You have been granted full access!" style="font-size: 10px; white-space: normal; -unity-text-align: upper-center; padding-right: 10px; padding-left: 10px; margin-top: 0; padding-top: 0; height: 25%;"/>
<ui:Label text="&lt;uppercase&gt;Time Remaining Until Expiry&lt;/uppercase&gt;" name="Label" style="font-size: 10px; -unity-font-style: bold; margin-bottom: 0; padding-bottom: 0; -unity-text-align: lower-center;"/>
<ui:Label text="Access Granted" name="Label" style="-unity-font-style: bold; font-size: 36px;"/>
<ui:Label text="Your membership is now active. You have been granted full access!" style="font-size: 24px; white-space: normal; -unity-text-align: upper-center; padding-right: 10px; padding-left: 10px; margin-top: 0; padding-top: 0; height: 25%;"/>
<ui:Label text="&lt;uppercase&gt;Time Remaining Until Expiry&lt;/uppercase&gt;" name="Label" style="font-size: 18px; -unity-font-style: bold; margin-bottom: 0; padding-bottom: 0; -unity-text-align: lower-center;"/>
<ui:VisualElement style="flex-grow: 0; flex-direction: row; align-items: stretch; align-content: auto; align-self: stretch; padding-left: 10px; padding-right: 10px; height: 25%;">
<ui:VisualElement style="flex-grow: 1; flex-wrap: nowrap;">
<ui:Label text="00" style="-unity-font-style: bold; justify-content: center; align-self: center; align-content: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; font-size: 32px; flex-grow: 1; -unity-text-align: lower-left;">
<ui:Label text="00" name="Label" style="-unity-font-style: bold; justify-content: center; align-self: center; align-content: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; font-size: 50px; flex-grow: 1; -unity-text-align: lower-left;">
<Bindings>
<ui:DataBinding property="text" data-source-path="Years" binding-mode="ToTarget"/>
</Bindings>
</ui:Label>
<ui:Label text="&lt;uppercase&gt;year&lt;/uppercase&gt;" style="flex-grow: 1; font-size: 10px; -unity-text-align: upper-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;"/>
<ui:Label text="&lt;uppercase&gt;year&lt;/uppercase&gt;" style="flex-grow: 1; font-size: 18px; -unity-text-align: upper-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; -unity-font-style: normal;"/>
</ui:VisualElement>
<ui:VisualElement style="flex-grow: 1;">
<ui:Label text="00" style="-unity-font-style: bold; justify-content: center; align-self: center; align-content: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; font-size: 32px; flex-grow: 1; -unity-text-align: lower-left;">
<ui:Label text="00" style="-unity-font-style: bold; justify-content: center; align-self: center; align-content: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; font-size: 50px; flex-grow: 1; -unity-text-align: lower-left;">
<Bindings>
<ui:DataBinding property="text" data-source-path="Months" binding-mode="ToTarget"/>
</Bindings>
</ui:Label>
<ui:Label text="&lt;uppercase&gt;month&lt;/uppercase&gt;" style="flex-grow: 1; font-size: 10px; -unity-text-align: upper-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;"/>
<ui:Label text="&lt;uppercase&gt;month&lt;/uppercase&gt;" style="flex-grow: 1; font-size: 18px; -unity-text-align: upper-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;"/>
</ui:VisualElement>
<ui:VisualElement style="flex-grow: 1;">
<ui:Label text="00" style="-unity-font-style: bold; justify-content: center; align-self: center; align-content: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; font-size: 32px; flex-grow: 1; -unity-text-align: lower-left;">
<ui:Label text="00" style="-unity-font-style: bold; justify-content: center; align-self: center; align-content: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; font-size: 50px; flex-grow: 1; -unity-text-align: lower-left;">
<Bindings>
<ui:DataBinding property="text" data-source-path="Days" binding-mode="ToTarget"/>
</Bindings>
</ui:Label>
<ui:Label text="&lt;uppercase&gt;Day&lt;/uppercase&gt;" style="flex-grow: 1; font-size: 10px; -unity-text-align: upper-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;"/>
<ui:Label text="&lt;uppercase&gt;Day&lt;/uppercase&gt;" style="flex-grow: 1; font-size: 18px; -unity-text-align: upper-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;"/>
</ui:VisualElement>
<ui:VisualElement style="flex-grow: 1;">
<ui:Label text="00" style="-unity-font-style: bold; justify-content: center; align-self: center; align-content: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; font-size: 32px; flex-grow: 1; -unity-text-align: lower-left;">
<ui:Label text="00" style="-unity-font-style: bold; justify-content: center; align-self: center; align-content: center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; font-size: 50px; flex-grow: 1; -unity-text-align: lower-left;">
<Bindings>
<ui:DataBinding property="text" data-source-path="Hours" binding-mode="ToTarget"/>
</Bindings>
</ui:Label>
<ui:Label text="&lt;uppercase&gt;Hour&lt;/uppercase&gt;" style="flex-grow: 1; font-size: 10px; -unity-text-align: upper-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;"/>
<ui:Label text="&lt;uppercase&gt;Hour&lt;/uppercase&gt;" name="Label" style="flex-grow: 1; font-size: 18px; -unity-text-align: upper-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;"/>
</ui:VisualElement>
</ui:VisualElement>
<ui:Button text="x" name="close-button" class="close-button" style="position: absolute; top: auto; bottom: 95%; left: 95%; width: 5%; height: 5%; border-top-left-radius: 25px; border-top-right-radius: 25px; border-bottom-right-radius: 25px; border-bottom-left-radius: 25px; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; aspect-ratio: 1;"/>
<ui:Button text="x" name="close-button" class="close-button" style="position: absolute; top: auto; bottom: 95%; left: 95%; width: 50px; height: 50px; border-top-left-radius: 25px; border-top-right-radius: 25px; border-bottom-right-radius: 25px; border-bottom-left-radius: 25px; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; aspect-ratio: 1; font-size: 32px;"/>
</ui:VisualElement>
</ui:UXML>
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
</Bindings>
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement name="VisualElement" style="flex-grow: 1; position: absolute; top: 80%; width: auto; height: 10%; align-self: center; justify-content: center; align-items: center; align-content: center; border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px; background-color: rgb(255, 255, 255); flex-direction: row; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;">
<ui:Label text="Press" name="Label" style="-unity-text-align: middle-left;"/>
<ui:VisualElement class="interact-input" style="flex-grow: 0; width: auto; position: relative; border-left-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); border-top-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); border-top-left-radius: 35px; border-top-right-radius: 35px; border-bottom-right-radius: 35px; border-bottom-left-radius: 35px; aspect-ratio: 1;">
<ui:Label text="E" name="Label" style="flex-grow: 1; -unity-text-align: middle-center; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; color: rgb(255, 255, 255); -unity-font-style: bold;"/>
<ui:VisualElement name="VisualElement" style="flex-grow: 1; position: absolute; top: 90%; width: auto; height: auto; align-self: center; justify-content: center; align-items: center; align-content: center; border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px; background-color: rgb(255, 255, 255); flex-direction: row; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;">
<ui:Label text="Press" name="Label" style="-unity-text-align: middle-left; font-size: 24px;"/>
<ui:VisualElement class="interact-input" style="flex-grow: 0; width: auto; position: relative; border-left-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); border-top-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); border-top-left-radius: 35px; border-top-right-radius: 35px; border-bottom-right-radius: 35px; border-bottom-left-radius: 35px; aspect-ratio: 1; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;">
<ui:Label text="E" name="Label" style="flex-grow: 1; -unity-text-align: middle-center; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; color: rgb(255, 255, 255); -unity-font-style: bold; font-size: 28px;"/>
</ui:VisualElement>
<ui:Label text="to interact" style="-unity-text-align: middle-left; margin-left: 4px; padding-left: 2px;"/>
<ui:Label text="to interact" style="-unity-text-align: middle-left; margin-left: 4px; padding-left: 2px; font-size: 24px;"/>
<Bindings>
<ui:DataBinding property="style.display" data-source-path="Interactable" binding-mode="ToTarget"/>
</Bindings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<Style src="project://database/Assets/Samples/Open%20Creator%20Rails%20Unity/0.1.0/Open%20Creator%20Rails%20Sample/UI/Styles.uss?fileID=7433441132597879392&amp;guid=13347270707df7b9e890b1552844e38c&amp;type=3#Styles"/>
<ui:VisualElement data-source-type="Io.ChainSafe.OpenCreatorRails.Samples.LandingModel, Assembly-CSharp" style="flex-grow: 1; background-color: rgb(255, 255, 255);">
<ui:VisualElement data-source-type="Io.ChainSafe.OpenCreatorRails.Samples.LandingModel, Assembly-CSharp" style="flex-grow: 1; align-self: center; justify-content: center;">
<ui:Button text="Connect" name="connect-button">
<ui:Button text="Connect" name="connect-button" style="font-size: 32px; padding-top: 20px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px; border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px;">
<Bindings>
<ui:DataBinding property="style.display" data-source-path="Disconnected" binding-mode="ToTarget"/>
</Bindings>
</ui:Button>
<ui:Button text="Disconnect" name="disconnect-button">
<ui:Button text="Disconnect" name="disconnect-button" style="font-size: 32px; padding-top: 20px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px; border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px;">
<Bindings>
<ui:DataBinding property="style.display" data-source-path="Connected" binding-mode="ToTarget"/>
</Bindings>
</ui:Button>
<ui:Button text="Resume" name="resume-button">
<ui:Button text="Resume" name="resume-button" style="font-size: 32px; padding-top: 20px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px; border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px;">
<Bindings>
<ui:DataBinding property="style.display" data-source-path="Paused" binding-mode="ToTarget"/>
</Bindings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Style src="project://database/Assets/Samples/Open%20Creator%20Rails%20Unity/0.1.0/Open%20Creator%20Rails%20Sample/UI/Styles.uss?fileID=7433441132597879392&amp;guid=13347270707df7b9e890b1552844e38c&amp;type=3#Styles"/>
<ui:VisualElement style="flex-grow: 1; background-color: rgba(17, 24, 39, 0.39);">
<ui:VisualElement style="flex-grow: 0; align-self: center; align-items: stretch; justify-content: center; width: 10%; height: 10%; position: absolute; top: 40%; bottom: 40%; aspect-ratio: 1;">
<Io.ChainSafe.OpenCreatorRails.Samples.LoadingSpinner width="3" color="rgb(255, 255, 255)" style="width: auto; height: auto; position: relative; align-self: center; align-content: auto; align-items: center; justify-content: center; aspect-ratio: 1; flex-grow: 1; flex-direction: column; flex-wrap: nowrap; top: auto; bottom: auto; left: auto; right: auto;"/>
<Io.ChainSafe.OpenCreatorRails.Samples.LoadingSpinner width="8" color="rgb(255, 255, 255)" style="width: auto; height: auto; position: relative; align-self: center; align-content: auto; align-items: center; justify-content: center; aspect-ratio: 1; flex-grow: 1; flex-direction: column; flex-wrap: nowrap; top: auto; bottom: auto; left: auto; right: auto;"/>
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
Loading