Mentions légales du service

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

:arrow_up: Update Dependency LSL4Unity

parent 92f519d8
Branches
No related tags found
No related merge requests found
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=assets_005Clsl4unity_005Cscripts/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
\ No newline at end of file
Subproject commit b3b35a12ec2fd26905a604fa63a50fa5c86c36e5
Subproject commit 5379c1a3fc9923bc882e4f75a8a8aa55a46fea21
......@@ -132,7 +132,6 @@ GameObject:
- component: {fileID: 102141082}
- component: {fileID: 102141081}
- component: {fileID: 102141080}
- component: {fileID: 102141079}
- component: {fileID: 102141083}
- component: {fileID: 102141085}
- component: {fileID: 102141084}
......@@ -143,19 +142,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &102141079
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 102141078}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &102141080
MeshRenderer:
m_ObjectHideFlags: 0
......@@ -230,8 +216,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
scale: 1
SignalInlet: {fileID: 102141085}
StimInlet: {fileID: 102141084}
signalInlet: {fileID: 102141085}
stimInlet: {fileID: 102141084}
--- !u!114 &102141084
MonoBehaviour:
m_ObjectHideFlags: 0
......
using System;
using System.Linq;
using LSL4Unity.OV;
using UnityEngine;
public class Controller : MonoBehaviour
......@@ -31,20 +32,18 @@ public class Controller : MonoBehaviour
}
// Change Scale
if (signalInlet.LastSample.Length > 0)
if (signalInlet.LastSample != null && signalInlet.LastSample.Length > 0)
{
float value = Math.Abs(signalInlet.LastSample[0]) * scale;
Debug.Log($"Sample : {value}");
if (value > 1e-6) { transform.localScale = new Vector3(value, value, value); }
}
// Change Color
if (stimInlet.LastSample.Length > 0)
if (stimInlet.LastSample != null && stimInlet.LastSample.Length > 0 && stimInlet.LastSample[0] == Stimulations.LABEL_00)
{
int value = stimInlet.LastSample[0];
colPos++;
if (colPos >= colors.Length) { colPos = 0; }
Debug.Log($"Stimulation : {value}, Pos : {colPos}, Color : {colors[colPos]}");
Debug.Log($"Stimulation received : {Stimulations.LABEL_00} {nameof(Stimulations.LABEL_00)}, new Pos : {colPos}, new Color : {colors[colPos]}");
// The Stimulation stay in the variable if we don't remove the first
stimInlet.LastSample = stimInlet.LastSample.Skip(1).ToArray();
material.SetColor(ColNameId, colors[colPos]);
......
using System;
using LSL4Unity.Scripts.OV;
using LSL4Unity.OV;
/// <summary> Just an example implementation for a Inlet receiving Float values for OpenViBE Link. </summary>
/// <seealso cref="OVFloatInlet" />
......
using LSL4Unity.Scripts.OV;
using LSL4Unity.OV;
using UnityEngine;
/// <summary> Implementation for a Inlet receiving Stimulations (int) from OpenViBE. </summary>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment