/extOSC.InEditor

OSC extension for Unity Editor based on extOSC.

Primary LanguageC#MIT LicenseMIT

extOSC.InEditor - Open Sound Control Protocol for Unity Editor

Created by iam1337

⚙ Build and Release openupm

Table of Contents

Introduction

This asset allows you to use all features of extOSC directly into the Unity Editor. To create your own OSC Editor Component, you only need to create a subclass from "OSCEditorReceiverComponent" or the "OSCEditorTransmitterComponent", and implement all the functions what you need.

Installation:

Be sure to install extOSC before installing.

Old school

Just copy the Assets/extOSC.InEditor folder into your Assets directory within your Unity project, or download latest extOSC.InEditor.unitypackage.

OpenUPM

Via openupm-cli:

openupm add com.iam1337.extosc.ineditor

Or if you don't have it, add the scoped registry to manifest.json with the desired dependency semantic version:

"scopedRegistries": [
	{
		"name": "package.openupm.com",
		"url": "https://package.openupm.com",
		"scopes": [
			"com.iam1337.extosc",
			"com.iam1337.extosc.ineditor",
		]
	}
],
"dependencies": {
	"com.iam1337.extosc": "1.19.9",
	"com.iam1337.extosc.ineditor": "1.0.0",
}

Package Manager

Project supports Unity Package Manager. To install the project as a Git package do the following:

  1. In Unity, open Window > Package Manager.
  2. Press the + button, choose "Add package from git URL..."
  3. Enter "https://github.com/iam1337/extOSC.InEditor.git#upm" and press Add.

Examples:

Custom OSC Editor Receiver Component

This example is implemented in a file: OSCEditorReceiverComponentExample.cs

[OSCEditorComponent("Examples", "Example Receiver Component")]
public class OSCEditorReceiverComponentExample : OSCEditorReceiverComponent
{
	#region Protected Methods

	protected override void PopulateBinds(List<IOSCBind> binds)
	{
		binds.Add(new OSCBind("/editor/example", MessageReceive));
	}

	#endregion

	#region Private Methods

	private void MessageReceive(OSCMessage message)
	{
		Debug.LogFormat("Received message: {0}", message);
	}

	#endregion
}

Custom OSC Editor Transmitter Component

This example is implemented in a file: OSCEditorTransmitterComponentExample.cs

[OSCEditorComponent("Examples", "Example Transmitter Component")]
public class OSCEditorTransmitterComponentExample : OSCEditorTransmitterComponent
{
	#region Protected Methods

	protected override void Update()
	{
		var message = new OSCMessage("/editor/example");
		message.AddValue(OSCValue.String("Editor message!"));

		Send(message);
	}

	#endregion
}

Screenshots

Author Contacts:

> telegram.me/iam1337
> ext@iron-wall.org

License

This project is under the MIT License.