This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.ComponentModel.DataAnnotations; | |
// .. snip removed a bunch of project (front end specific) usings | |
using Assets.Scripts.Utilities.Dbo; // to eensure interfaces are known | |
namespace Assets.Scripts.Utilities |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connection.On("broadcastMessage", (data) => | |
{ | |
//do stuff with 'data' from web rpc call | |
}); | |
//-- | |
connection.InvokeAsync("Send", newData); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<linker> | |
<assembly fullname="System.Core"> | |
<type fullname="System.Linq.Expressions.Interpreter.LightLambda" preserve="all" /> | |
</assembly> | |
</linker> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MessagePackObject] | |
public class AudioData | |
{ | |
[Key(0)] | |
public byte[] data { get; set; } | |
[Key(1)] | |
public int length { get; set; } | |
[Key(2)] | |
public int count { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (decoder != null) | |
{ | |
var pcmLength = decoder.Decode(encodedData, 0, length, pcmBuffer, 0, pcmBuffer.Length); | |
if (audioClipData == null || audioClipData.Length != pcmLength) | |
{//make sure that audioclip data length is the same w/ each received packet | |
audioClipData = new float[pcmLength]; | |
} | |
Array.Copy(pcmBuffer, audioClipData, pcmLength); | |
source.clip.SetData(audioClipData, samplePos); | |
samplePos += pcmLength; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(receivedSamples.Count != 0) | |
{ | |
var recv = receivedSamples.Pop(); | |
frameSize = OpusPacketInfo.GetNumSamples(decoder, recv, 0, recv.Length); | |
float[] recvOutput = new float[frameSize]; | |
int thisFrameSize = decoder.Decode(recv, 0, recv.Length, recvOutput, 0, frameSize); | |
decodedSamples.Push(recvOutput); | |
if(decodedSamples.Count >= 100) | |
{ | |
for(int i = 0; i < decodedSamples.Count; i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CockpitTraining; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using UnityEditor; | |
using UnityEditor.IMGUI.Controls; | |
using UnityEngine; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class YourObject | |
{ | |
public YourObject() {}//do whatever here | |
public /*virtual*/ void OnUpdate(float deltaTime) {} | |
} | |
public class UnityHook : MonoBehaviour | |
{ | |
public int TotalObjects; | |
List<YourObject> objects; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System; | |
[ExecuteInEditMode] | |
public class SubdivideBoundingBoxIntoSmallerBoxes : MonoBehaviour | |
{ | |
public Color boundingBoxColor; |
NewerOlder