An open API service indexing awesome lists of open source software.

https://github.com/iam1337/extosc.ineditor

OSC extension for Unity Editor based on extOSC.
https://github.com/iam1337/extosc.ineditor

csharp editor-extension extosc osc remote-control unity unity-editor unity3d

Last synced: 4 months ago
JSON representation

OSC extension for Unity Editor based on extOSC.

Awesome Lists containing this project

README

        

# extOSC.InEditor - Open Sound Control Protocol for Unity Editor

Created by [iam1337](https://github.com/iam1337)

![](https://img.shields.io/badge/unity-2021.1%20or%20later-green.svg)
[![⚙ Build and Release](https://github.com/Iam1337/extOSC.InEditor/actions/workflows/ci.yml/badge.svg)](https://github.com/Iam1337/extOSC.InEditor/actions/workflows/ci.yml)
[![openupm](https://img.shields.io/npm/v/com.iam1337.extosc.ineditor?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.iam1337.extosc.ineditor/)
[![](https://img.shields.io/github/license/iam1337/extOSC.InEditor.svg)](https://github.com/Iam1337/extOSC.InEditor/blob/master/LICENSE)

### Table of Contents
- [Introduction](#introduction)
- [Installation](#installation)
- [Examples](#examples)
- - [Custom OSC Editor Receiver Component](#custom-osc-editor-receiver-component)
- - [Custom OSC Editor Transmitter Component](#custom-osc-editor-transmitter-component)
- [Author Contacts](#author-contacts)

## 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](https://github.com/Iam1337/extOSC) before installing.

**Old school**

Just copy the [Assets/extOSC.InEditor](Assets/extOSC.InEditor) folder into your Assets directory within your Unity project, or [download latest extOSC.InEditor.unitypackage](https://github.com/iam1337/extOSC.InEditor/releases).

**OpenUPM**

Via [openupm-cli](https://github.com/openupm/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](Assets/extEditorOSC/Examples/Scripts/Editor/OSCEditorReceiverComponentExample.cs)
```C#
[OSCEditorComponent("Examples", "Example Receiver Component")]
public class OSCEditorReceiverComponentExample : OSCEditorReceiverComponent
{
#region Protected Methods

protected override void PopulateBinds(List 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](Assets/extEditorOSC/Examples/Scripts/Editor/OSCEditorTransmitterComponentExample.cs)
```C#
[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](http://telegram.me/iam1337)

\> [[email protected]](mailto:[email protected])

## License
This project is under the MIT License.