Exemplo n.º 1
0
    private void removeCursorForCluster(MotionMapCursor mmc)
    {
        Debug.Log("Remove cursor ");
        cursors.Remove(mmc);
        Destroy(mmc.gameObject);

        if (handler.clusters.Count == 0)
        {
            Invoke("startDemo", demoModeTime);
        }
    }
Exemplo n.º 2
0
    private void clusterUpdated(Cluster c)
    {
        MotionMapCursor cursor = getCursorForClusterID(c);

        if (cursor == null)
        {
            Debug.Log("Cursor not found for updated cluster " + c.id);
            return;
        }

        cursor.update(c.center, c.orientation);
    }
Exemplo n.º 3
0
    private void clusterRemoved(Cluster c)
    {
        Debug.Log("Cluster removed");
        MotionMapCursor mmc = getCursorForClusterID(c);

        if (clustersToAdd.Contains(c))
        {
            clustersToAdd.Remove(c);
        }
        if (mmc == null)
        {
            Debug.Log("No cursor found for removed cluster " + c.id);
            return;
        }

        clustersToRemove.Add(mmc);
    }
Exemplo n.º 4
0
    private void addCursorForCluster(Cluster c)
    {
        if (getCursorForClusterID(c) == null)
        {
            Debug.Log("Add cursor for cluster " + c.id);
            MotionMapCursor cursor = Instantiate(cursorPrefab).GetComponent <MotionMapCursor>();
            cursor.clusterID = c.id;
            cursor.transform.SetParent(transform.Find("Cursors"));
            cursors.Add(cursor);
            cursor.setColor(Color.HSVToRGB(cursor.clusterID * .31f, 1, 1));
        }
        else
        {
            Debug.Log("Cursor already exists for cluster " + c.id);
        }

        CancelInvoke("startDemo");
        if (demoMode)
        {
            stopDemo();
        }
    }