Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    //private ComplexF[] fft;

    public void Awake()
    {
        Debug.Log("Start SomaxisGraph");
        SomaxisManager.GetInstance().AddReadingListener(this);
        CreatePoints();
        lr = GetComponent <LineRenderer> ();
        //lr.SetWidth (0.2f, 0.2f);
    }
Ejemplo n.º 3
0
 public void SetOwner(SomaxisManager mm)
 {
     owner = mm;
 }