public static SomaxisManager GetInstance() { if (isMockOn == null) { isMockOn = false; } if (instance == null) { Debug.Log("getting lock"); lock (_lock) { if (instance == null) { container = new GameObject("SomaxisManager"); instance = container.AddComponent(typeof(SomaxisManager)) as SomaxisManager; mockTrackerContainer = new GameObject("mockTrackerContainer"); Debug.Log("made mock tracker"); instance.trackerMock = mockTrackerContainer.AddComponent(typeof(SomaxisTrackerMock)) as SomaxisTrackerMock; ((instance.trackerMock) as SomaxisTrackerMock).SetOwner(instance); nativeTrackerContainer = new GameObject("nativeTrackerContainer"); instance.trackerNative = nativeTrackerContainer.AddComponent(typeof(SomaxisTrackerNative)) as SomaxisTrackerNative; ((instance.trackerNative) as SomaxisTrackerNative).SetOwner(instance); feedbackTexture = new Texture2D(256, 256, TextureFormat.ARGB32, false); DontDestroyOnLoad(container); DontDestroyOnLoad(nativeTrackerContainer); DontDestroyOnLoad(mockTrackerContainer); } } } return(instance); }
//private ComplexF[] fft; public void Awake() { Debug.Log("Start SomaxisGraph"); SomaxisManager.GetInstance().AddReadingListener(this); CreatePoints(); lr = GetComponent <LineRenderer> (); //lr.SetWidth (0.2f, 0.2f); }
public void SetOwner(SomaxisManager mm) { owner = mm; }