This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 305
/
create-assets-package-for-unity.sh
59 lines (41 loc) · 2.38 KB
/
create-assets-package-for-unity.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
##########################################################################################
##
## This script creates a tarball that can be easily dropped into your Unity
## Project's "Assets" folder to use Forge Networking from sources.
##
## For more information, visit this link:
## https://github.com/BeardedManStudios/ForgeNetworkingRemastered/wiki/Getting-Started
##
##########################################################################################
set -e
set -u
function cleanup() {
rm -rf "$DIR_TMP_FN"
}
trap 'cleanup' EXIT
DIR_TMP_FN="$(mktemp -d 'ForgeNetworking.tmp.XXXXXXXXXX')"
DIR_ASSETS="$DIR_TMP_FN/Assets"
mkdir "$DIR_ASSETS"
FILE_TAR="ForgeNetworking-source-assets.tar"
echo "* Copying source files ..."
# 2) Copy the `ForgeNetworkingRemastered\Forge Networking Remastered Unity\Assets\Bearded Man Studios Inc\` folder into your assets
cp -a 'Forge Networking Remastered Unity/Assets/Bearded Man Studios Inc' "$DIR_ASSETS/"
# 3) Remove the `Assets\Bearded Man Studios Inc\Plugins\` folder
rm -rf "$DIR_ASSETS/Bearded Man Studios Inc/"{Plugins,Plugins.meta}
# 4) Copy the `ForgeNetworkingRemastered\BeardedManStudios\Source` folder into `Assets\Bearded Man Studios Inc\`
cp -a 'BeardedManStudios/Source/' "$DIR_ASSETS/Bearded Man Studios Inc/"
# 5) Remove the contents of `Assets\Bearded Man Studios Inc\Editor\`, leaving the `Resources\` folder
rm -rf "$DIR_ASSETS/Bearded Man Studios Inc/Editor/ForgeNetworkingUnityEditor."*
# 6) Copy the .cs files from `ForgeNetworkingRemastered\ForgeNetworkingUnityEditor\` into `Assets\Bearded Man Studios Inc\Editor\`
cp -a 'ForgeNetworkingUnityEditor/'*.cs "$DIR_ASSETS/Bearded Man Studios Inc/Editor/"
# 7) Copy the `ForgeNetworkingRemastered\ForgeNetworkingCommon\Templating\` folder into `Assets\Bearded Man Studios Inc\`
cp -a 'ForgeNetworkingCommon/Templating/' "$DIR_ASSETS/Bearded Man Studios Inc/"
echo "* Creating tarball ..."
tar cf "$FILE_TAR" -C "$DIR_TMP_FN" Assets
echo
echo -e "A file with name \`\033[0;33;1m$FILE_TAR\033[0m' has been created."
echo "Extract this file to your Unity Project. Now you should be ready to go using Forge Networking from sources."
echo
echo "If you need help using this script or Forge Networking in general, you can join our Discord Server here: https://discord.gg/yzZwEYm"
echo