Skip to content

Commit 0b0482e

Browse files
committed
Add plugin foundation (#2)
feat: Unity plugin foundations
1 parent 832f1ee commit 0b0482e

50 files changed

Lines changed: 2649 additions & 16 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
# Created by https://www.toptal.com/developers/gitignore/api/unity
2-
# Edit at https://www.toptal.com/developers/gitignore?templates=unity
3-
4-
### Unity ###
51
# This .gitignore file should be placed at the root of your Unity project directory
62
#
73
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
4+
#
85
/[Ll]ibrary/
96
/[Tt]emp/
107
/[Oo]bj/
@@ -74,5 +71,6 @@ crashlytics-build.properties
7471
/[Aa]ssets/[Ss]treamingAssets/aa.meta
7572
/[Aa]ssets/[Ss]treamingAssets/aa/*
7673

77-
# End of https://www.toptal.com/developers/gitignore/api/unity
78-
74+
# Additional Rivet items
75+
**/.DS_Store
76+
/ProjectSettings

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"visualstudiotoolsforunity.vstuc"
4+
]
5+
}

.vscode/launch.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach to Unity",
6+
"type": "vstuc",
7+
"request": "attach"
8+
}
9+
]
10+
}

.vscode/settings.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"files.exclude": {
3+
"**/.DS_Store": true,
4+
"**/.git": true,
5+
"**/.vs": true,
6+
"**/.gitmodules": true,
7+
"**/.vsconfig": true,
8+
"**/*.booproj": true,
9+
"**/*.pidb": true,
10+
"**/*.suo": true,
11+
"**/*.user": true,
12+
"**/*.userprefs": true,
13+
"**/*.unityproj": true,
14+
"**/*.dll": true,
15+
"**/*.exe": true,
16+
"**/*.pdf": true,
17+
"**/*.mid": true,
18+
"**/*.midi": true,
19+
"**/*.wav": true,
20+
"**/*.gif": true,
21+
"**/*.ico": true,
22+
"**/*.jpg": true,
23+
"**/*.jpeg": true,
24+
"**/*.png": true,
25+
"**/*.psd": true,
26+
"**/*.tga": true,
27+
"**/*.tif": true,
28+
"**/*.tiff": true,
29+
"**/*.3ds": true,
30+
"**/*.3DS": true,
31+
"**/*.fbx": true,
32+
"**/*.FBX": true,
33+
"**/*.lxo": true,
34+
"**/*.LXO": true,
35+
"**/*.ma": true,
36+
"**/*.MA": true,
37+
"**/*.obj": true,
38+
"**/*.OBJ": true,
39+
"**/*.asset": true,
40+
"**/*.cubemap": true,
41+
"**/*.flare": true,
42+
"**/*.mat": true,
43+
"**/*.meta": true,
44+
"**/*.prefab": true,
45+
"**/*.unity": true,
46+
"build/": true,
47+
"Build/": true,
48+
"Library/": true,
49+
"library/": true,
50+
"obj/": true,
51+
"Obj/": true,
52+
"Logs/": true,
53+
"logs/": true,
54+
"ProjectSettings/": true,
55+
"UserSettings/": true,
56+
"temp/": true,
57+
"Temp/": true
58+
},
59+
"dotnet.defaultSolution": "plugin-unity.sln"
60+
}

Assets/Rivet.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Rivet/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# MARK: Runner
2+
FROM ubuntu:22.04
3+
WORKDIR /app
4+
5+
# Install necessary libraries for Unity
6+
RUN apt-get update && apt-get install -y \
7+
ca-certificates \
8+
&& update-ca-certificates \
9+
&& rm -rf /var/lib/apt/lists/* \
10+
&& useradd -ms /bin/bash rivet
11+
12+
# Copy the precompiled Unity server files
13+
COPY ./Builds/Game /app/Game
14+
# COPY ./Builds/Game_BurstDebugInformation_DoNotShip /app/Game_BurstDebugInformation_DoNotShip
15+
# COPY ./Builds/Game_Data /app/Game_Data
16+
# COPY ./Builds/UnityPlayer.so /app/UnityPlayer.so
17+
18+
# Change to user rivet
19+
USER rivet
20+
21+
ENV UNITY_SERVER=1
22+
23+
# Run the server
24+
ENTRYPOINT ["./Game", "-batchmode", "-nographics"]

Assets/Rivet/Dockerfile.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Rivet/Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using UnityEditor;
2+
using UnityEditor.Build;
3+
using UnityEditor.Build.Reporting;
4+
using UnityEngine;
5+
6+
public class BuildScript : IPreprocessBuildWithReport, IPostprocessBuildWithReport
7+
{
8+
public int callbackOrder { get { return 0; } }
9+
10+
public void OnPreprocessBuild(BuildReport report)
11+
{
12+
// Create the asset file before the build
13+
RivetSettings data = ScriptableObject.CreateInstance<RivetSettings>();
14+
// data.SomeData = "Some data from the plugin";
15+
AssetDatabase.CreateAsset(data, "Assets/rivet_export.asset");
16+
AssetDatabase.SaveAssets();
17+
}
18+
19+
public void OnPostprocessBuild(BuildReport report)
20+
{
21+
// Delete the asset file after the build
22+
AssetDatabase.DeleteAsset("Assets/rivet_export.asset");
23+
}
24+
}

Assets/Rivet/Editor/BuildPipeline.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)