/SRXDVisualsProjectTemplate

A Unity project template for creating custom visuals

Primary LanguageC#

SRXDVisualsProjectTemplate

A Unity project template for creating custom visuals.

Getting Started

Creating a New Visual Element

  • Create a new folder in the Assets folder to contain the assets for your visual element
  • In this new folder, create a Scripts folder to contain any scripts used by your visual element. Add an assembly definition to this folder and specify srxdbackgrounds.common as one of its dependencies
  • Create a new GameObject in your scene. Ensure that the prefab's transform is all 0 for position and rotation, and all 1 for scale
  • Add the VisualsEventReceiver script to your GameObject
  • Drag the GameObject into your new assets folder to create a prefab
  • After adding visuals to your prefab, press Play to enter the game view and see a preview of how the scene will appear in-game

Building Asset Bundles and Adding Them to SRXD

  • Select your prefab asset and assign an asset bundle at the bottom of the Inspector
  • Open the AssetBundle Browser (Window > AssetBundle Browser) and click Build
  • By default, all Asset Bundles will be built to
    • <Project Folder>\AssetBundles\StandaloneWindows
  • Go to your BepInEx plugins folder
  • Copy both the asset bundle file and manifest file for each bundle to the AssetBundles folder
  • Create a new .json file in the Backgrounds folder. Add the following, filling in the appropriate bundle, assembly, and prefab names:
{
	"disableBaseBackground": true,
	"useAudioSpectrum": false,
	"useAudioWaveform": false,
	"useDepthTexture": false,
	"farClip": 100,
	"assetBundles": [
		"<Bundle Name>",
		"common"
	],
	"assemblies": [
		"<Assembly Name>",
		"SRXDBackgrounds.Common.dll"
	],
	"elements": [
		{
			"bundle": "<Bundle Name>",
			"asset": "<Prefab Name>",
			"root": 1
		}
	]
}