Skip to content

Commit b2dcc78

Browse files
Release 1.0.3 (#62)
* Patch fixes for Unity 2022 * Switch test step to multi-version build * Include Unity UI as a dependency for 2022, because Unity. * Added an additional option (now the default) to copy all files from a path to the local project when installing a package. (#53) This is due to a change in how RCT uses hidden folders instead of an immutable path. * Updated the assets installer to warn the user to use Unity's Material Upgrade utility if any materials were included in copied assets for a package. * Bump utilities dependency to resolve Unity 2023 issues * Update inspector logo with dark/light theme variants * Update docs, templates and dependencies --------- Co-authored-by: Simon Jackson <[email protected]> Co-authored-by: Dino Fejzagić <[email protected]>
1 parent 6fefe33 commit b2dcc78

15 files changed

+433
-26
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: Bug report
3+
about: Create a report to identify a potential issue
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
# Reality Collective - Service Framework Bug Report
10+
11+
## Describe the bug
12+
<!-- Please provide a clear and concise description of what the bug is. -->
13+
14+
## To Reproduce
15+
<!-- Include Steps to reproduce the behavior: -->
16+
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
## Expected behavior
23+
<!-- A clear and concise description of what you expected to happen. -->
24+
25+
## Actual behavior
26+
<!-- What is actually happening -->
27+
28+
## Screenshots
29+
<!-- If applicable, add screenshots to help explain your problem. -->
30+
31+
## Your Setup
32+
<!-- please complete any/all the following information. -->
33+
34+
- **Operating System:**
35+
<!-- Please Specify Platform -->
36+
- [ ] Windows
37+
- [ ] MacOs
38+
- [ ] Linux
39+
- [ ] Other
40+
41+
- **Target Platforms:**
42+
<!-- Please Specify Platform -->
43+
- [ ] WindowsXR
44+
- [ ] HoloLens
45+
- [ ] Meta Quest
46+
- [ ] Pico
47+
- [ ] Other (please specifiy)
48+
49+
- **Unity Version:**
50+
<!-- Please Specify Version -->
51+
52+
- 2021.3.xxf
53+
54+
- **Related Packages**
55+
- [ ] com.org.package 1.0.0 <!-- Please Specify Version or commit sha -->
56+
<!-- - [ ] com.realitytoolkit.other 1.0.0 -->
57+
58+
## Additional context
59+
<!-- Add any other context about the problem here. -->
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for the Service Framework package
4+
title: ''
5+
labels: feature request
6+
assignees: ''
7+
---
8+
9+
# Reality Collective - Service Framework Feature Request
10+
11+
## Is your feature request related to a problem? Please describe
12+
13+
<!--Please provide a clear and concise description of what the problem is.
14+
E.g. I'm always frustrated when [...]-->
15+
16+
## How would you classify your suggestion
17+
<!--What type of enhancement is it, e.g:-->
18+
19+
- New platform support
20+
- Usability / Configuration
21+
- Architecture / Services
22+
23+
## Describe the solution you'd like
24+
<!--A clear and concise description of what you want to happen.-->
25+
26+
## Describe alternatives you've considered
27+
<!--A clear and concise description of any alternative solutions or features you've considered.-->
28+
29+
## Additional context
30+
<!--Add any other context or screenshots about the feature request here.-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Request for Information
3+
about: Not sure how to do something, just ask.
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
---
8+
9+
# Reality Collective - Service Framework Request for Information
10+
11+
<!-- As imperfect beings, we try to teach and show how to make using the framework easy to handle, but sometimes we will fall short. Help us to better educate adopters by pointing out where we need to give more information. -->
12+
13+
## What are you trying to achieve?
14+
15+
<!--
16+
Add a clear and concise description of what is it you are trying to implement.
17+
Include screenshots or examples from other projects if it helps.
18+
-->
19+
20+
## What have you already tried
21+
22+
<!--
23+
Have you tried to complete the task yourself but couldn't figure it out, if so what and why?
24+
-->
25+
26+
## What material have you referenced that didn't answer your question
27+
28+
<!--
29+
What other content have you tried reading / viewing that didn't answer your question?
30+
-->

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Reality Collective - Reality Toolkit Pull Request
1+
# Reality Collective - Service Framework Pull Request
22

33
## Overview
44
<!-- Please provide a clear and concise description of the pull request. -->

.github/workflows/development-buildandtestupmrelease.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ jobs:
3434
Run-Unit-Tests:
3535
name: Run Unity Unit Tests
3636
needs: Validate-Unity
37-
uses: realitycollective/reusableworkflows/.github/workflows/rununityUPMbuild.yml@v2
37+
uses: realitycollective/reusableworkflows/.github/workflows/rununityUPMbuildmultiversion.yml@v2
3838
with:
39-
unityversion: ${{ needs.Validate-Unity.outputs.unityeditorversion }}
4039
dependencies: '[{"development": "github.com/realitycollective/com.realitycollective.buildtools.git"},{"development": "github.com/realitycollective/com.realitycollective.utilities.git"}]'
4140
secrets: inherit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Service Framework
2+
3+
The Service Framework package by the [Reality Collective](https://www.realityCollective.io). This package is an extensible service framework to build highly performant components for your Unity projects.
4+
5+
## Overview
6+
7+
The Service framework provides a service repository for enabling background services to run efficiently in a Unity project, it features capabilities such as:
8+
9+
- Platform specific operation - choose which platforms your service runs on.
10+
- Zero Latency from Unity operations - services are fully c# based with no Unity overhead.
11+
- Ability to host several sub-services (service modules) as part of a service, automatically maintained by a parent service and also platform aware.
12+
- Fully configurable with Scriptable profiles - Each service can host a configuration profile to change the behaviour of your service without changing code.
13+
14+
## Requirements
15+
16+
- [Unity 2021.3 or above](https://unity.com/)
17+
- [RealityCollective.Utilities](https://github.com/realitycollective/com.realitycollective.utilities)
18+
19+
### OpenUPM
20+
21+
The simplest way to getting started using the utilities package in your project is via OpenUPM. Visit [OpenUPM](https://openupm.com/docs/) to learn more about it. Once you have the OpenUPM CLI set up use the following command to add the package to your project:
22+
23+
```text
24+
openupm add com.realitycollective.service-framework
25+
```
26+
27+
## Use cases
28+
29+
The service framework has been the foundation behind such toolkit's as Microsoft's MRTK and open source projects like the XRTK and newly formed [Reality Toolkit](https://www.realitytoolkit.io/). These utilise the framework to enable such use cases as:
30+
31+
- A platform independent input system - A single service able to route input data from multiple controllers on various platforms, each controller only activates on the platform it was designed for.
32+
- An Authentication service - Able to integrate with multiple authentication providers as needed through a single interface.
33+
- A networking service - Utilising multiple endpoints for Lobbys, communication routes and data sharing.
34+
35+
The possibilities are almost endless.
36+
37+
---
38+
39+
## Getting Started
40+
41+
### 1. Creating a service
42+
43+
A fully featured "Service Generator" is included with the Service Framework to get you quickly started, by simply giving a service a name and a namespace with which to run from, the generator will quickly create:
44+
45+
- An interface to identify your service to the Service Framework (all services are identified by their parent interface)
46+
- A configuration profile - to customise to the needs of your service (optional, delete if not required)
47+
- The Service Implementation - You service to do with as you wish.
48+
49+
Additionally, the generator can also create additional data providers (sub services) for your service to maintain, these require you to specify the parent services interface when generating to ensure they are appropriately bound in creation. Data Providers are automatically started with a parent service provided their platforms match the current operating environment.
50+
51+
### 2. Configuring your service
52+
53+
With your service created, it will need to be registered with an active "Service Manager" in a scene, this can either use the provided "Service Manager Instance" component on a GameObject, or uitilised as a private property on a class of your own.
54+
55+
> Note, at this time, only a single Service Framework Manager can be active in the scene at a time.
56+
57+
Simply create an empty GameObject and add the **ServiceManagerInstance** component to it to begin. From there it is simply a matter of creating a Profile for the Service Manager and then adding your services to it.
58+
59+
### 3. Accessing your running services
60+
61+
Your services are available at any time from anywhere in your code by simply requesting the service from the Service Manager using its interface (Data Providers are also accessible directly, although we recommend working through your service), for example:
62+
63+
```csharp
64+
var myService = ServiceManager.Instance.GetService<MyServiceInterface>();
65+
```
66+
67+
Alternatively, there are also TryGet versions of the Service endpoints which return a bool to denote the service retrieval was successful and an out parameter to output the service instance, for example:
68+
69+
```csharp
70+
IService myServiceInstance;
71+
if(!ServiceManager.Instance.TryGetService<MyServiceInterface>(out myServiceInstance))
72+
{
73+
// Do something if your service was not found.
74+
}
75+
```
76+
77+
---
78+
79+
## Feedback
80+
81+
Please feel free to provide feedback via the [Reality Toolkit dev channel here](https://github.com/realitycollective/com.realitycollective.service-framework/issues), all feedback. suggestions and fixes are welcome.
82+
83+
---
84+
85+
## Related Articles
86+
87+
- [Welcome to the Service Framework](https://service-framework.realitycollective.io/docs/get-started)
88+
- [Introduction](https://service-framework.realitycollective.io/docs/basics/introduction)
89+
- [Creating your first service](https://service-framework.realitycollective.io/docs/basics/getting_started)
90+
- [Roadmap](https://service-framework.realitycollective.io/docs/basics/roadmap)
91+
92+
---
93+
94+
## Raise an Information Request
95+
96+
If there is anything not mentioned in this document or you simply want to know more, raise an [RFI (Request for Information) request here](https://github.com/realitycollective/com.realitycollective.service-framework/issues/new?assignees=&labels=question&template=request_for_information.md).
97+
98+
Or simply [**join us on Discord**](https://discord.gg/YjHAQD2XT8) and come chat about your questions, we would love to hear from you

Editor/Packages/AssetsInstaller.cs

+27-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System;
77
using System.Collections.Generic;
88
using System.IO;
9+
using System.Linq;
910
using UnityEditor;
1011
using UnityEngine;
1112

@@ -46,8 +47,8 @@ public struct AssetInstallerEventArgs
4647
/// <param name="regenerateGuids">Should the guids for the copied assets be regenerated?</param>
4748
/// <param name="skipDialog">If set, assets and configuration is installed without prompting the user.</param>
4849
/// <returns><c>true</c> if the assets were successfully installed to the project.</returns>
49-
public static bool TryInstallAssets(string sourcePath, string destinationPath, bool regenerateGuids = false, bool skipDialog = false)
50-
=> TryInstallAssets(new Dictionary<string, string> { { sourcePath, destinationPath } }, regenerateGuids, skipDialog);
50+
public static bool TryInstallAssets(string sourcePath, string destinationPath, bool regenerateGuids = false, bool skipDialog = false, bool onlyUnityAssets = false)
51+
=> TryInstallAssets(new Dictionary<string, string> { { sourcePath, destinationPath } }, regenerateGuids, skipDialog, onlyUnityAssets);
5152

5253
/// <summary>
5354
/// Attempt to copy any assets found in the source path into the project.
@@ -56,7 +57,7 @@ public static bool TryInstallAssets(string sourcePath, string destinationPath, b
5657
/// <param name="regenerateGuids">Should the guids for the copied assets be regenerated?</param>
5758
/// <param name="skipDialog">If set, assets and configuration is installed without prompting the user.</param>
5859
/// <returns><c>true</c> if the assets were successfully installed to the project.</returns>
59-
public static bool TryInstallAssets(Dictionary<string, string> installationPaths, bool regenerateGuids = false, bool skipDialog = false)
60+
public static bool TryInstallAssets(Dictionary<string, string> installationPaths, bool regenerateGuids = false, bool skipDialog = false, bool onlyUnityAssets = false)
6061
{
6162
var anyFail = false;
6263
var newInstall = true;
@@ -74,7 +75,14 @@ public static bool TryInstallAssets(Dictionary<string, string> installationPaths
7475
newInstall = false;
7576
EditorUtility.DisplayProgressBar("Verifying assets...", $"{sourcePath} -> {destinationPath}", 0);
7677

77-
installedAssets.AddRange(UnityFileHelper.GetUnityAssetsAtPath(destinationPath));
78+
if (onlyUnityAssets)
79+
{
80+
installedAssets.AddRange(UnityFileHelper.GetUnityAssetsAtPath(destinationPath));
81+
}
82+
else
83+
{
84+
installedAssets.AddRange(UnityFileHelper.GetAllFilesAtPath(destinationPath));
85+
}
7886

7987
for (int i = 0; i < installedAssets.Count; i++)
8088
{
@@ -97,7 +105,16 @@ public static bool TryInstallAssets(Dictionary<string, string> installationPaths
97105

98106
EditorUtility.DisplayProgressBar("Copying assets...", $"{sourcePath} -> {destinationPath}", 0);
99107

100-
var copiedAssets = UnityFileHelper.GetUnityAssetsAtPath(sourcePath);
108+
var copiedAssets = new List<string>();
109+
110+
if (onlyUnityAssets)
111+
{
112+
copiedAssets = UnityFileHelper.GetUnityAssetsAtPath(destinationPath);
113+
}
114+
else
115+
{
116+
copiedAssets = UnityFileHelper.GetAllFilesAtPath(sourcePath);
117+
}
101118

102119
for (var i = 0; i < copiedAssets.Count; i++)
103120
{
@@ -146,6 +163,11 @@ public static bool TryInstallAssets(Dictionary<string, string> installationPaths
146163
GuidRegenerator.RegenerateGuids(installedDirectories);
147164
}
148165

166+
if (installedAssets.Where(asset => asset.Contains(".mat")).Any())
167+
{
168+
EditorUtility.DisplayDialog("Attention!", $"Materials were included in the Asset bundle copied to\n[{installationPaths.Values.First()}]\n\n If you are using URP or HDRP, we recommend you upgrade the shaders for these materials for use with URP/HDRP using Unity's tool found under\n Window > Rendering > Render Pipeline Converter.", "OK");
169+
}
170+
149171
EditorUtility.ClearProgressBar();
150172
AssetsInstalled?.Invoke(new AssetInstallerEventArgs
151173
{

0 commit comments

Comments
 (0)