feat: adds scriptableobject example

This commit is contained in:
Matteo Cominetti
2021-01-12 18:45:43 +00:00
parent 43c6643d1a
commit a4e0f06013
8 changed files with 131 additions and 8 deletions
+28
View File
@@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using Speckle.ConnectorUnity;
using UnityEngine;
//This class shows how to use the ScriptableObject Receiver to receive data in game time
//From the editor navigate to Assets > Create > ScriptableObjects > Receiver
//Set the StreamId on the new DataReceiver created
//Attach it to this script's 'receiver'
//To be honest, creating the Receiver form code is just simpler...!
public class ScriptableObjectExample : MonoBehaviour
{
public Receiver receiver;
void Start()
{
receiver.Init();
receiver.Receive().ConfigureAwait(false);
//... do more stuff eg set materials, subscribe to changes etc
}
void Update()
{
}
}