Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 746bf088 authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut
Browse files

:sparkles: Add LSL Scale

parent cd191db6
No related branches found
No related tags found
No related merge requests found
Subproject commit 7e365f7905d737065d7fd7d318a66b03d4c12ab7
Subproject commit a397960001100dd93651114f41e212d7e07f7036
......@@ -134,6 +134,7 @@ GameObject:
- component: {fileID: 102141080}
- component: {fileID: 102141079}
- component: {fileID: 102141083}
- component: {fileID: 102141084}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
......@@ -227,6 +228,23 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3fccaf98eee689c43b2b0a573f7f5e21, type: 3}
m_Name:
m_EditorClassIdentifier:
Scale: 2
--- !u!114 &102141084
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 102141078}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1da38a6a9335e8e48af8b17d9c369265, type: 3}
m_Name:
m_EditorClassIdentifier:
Moment: 1
StreamName: ovSignal
StreamType:
LastSample: []
--- !u!1 &208898348
GameObject:
m_ObjectHideFlags: 0
......
using UnityEngine;
using System;
using UnityEngine;
public class Controller : MonoBehaviour
{
public float Scale = 1;
private FloatInlet _inlet;
// Start is called before the first frame update
void Start() { }
void Start()
{
_inlet = FindObjectOfType<FloatInlet>();
Debug.Log(_inlet.StreamName);
}
// Update is called once per frame
void Update()
private void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
Debug.Log("Quit Game...");
Application.Quit();
}
if (_inlet.LastSample.Length > 0)
{
var value = Math.Abs(_inlet.LastSample[0]) * Scale;
if (value > 1e-6) { transform.localScale = new Vector3(value, value, value); }
}
}
// Fixupdate is called once per physics framerate
// private void FixedUpdate() { }
}
using LSL4Unity.Scripts;
public class FloatInlet : AFloatInlet
{
public float[] LastSample;
protected override void Process(float[] newSample, double timeStamp) { LastSample = newSample; }
}
fileFormatVersion: 2
guid: 1da38a6a9335e8e48af8b17d9c369265
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment