Example #1
0
    private void ViveBridge_MenuUnclicked(object sender, ClickedEventArgs e)
    {
        switch (ViveBridge.InteractionMode)
        {
        case InteractionMode.SpawnPrimitives:
            if (isLocalPlayer)
            {
                lastCollided = string.Empty;
                primitiveManager.RemoveLastBox();
                if (primitiveManager.IndicatorCount == 0)
                {
                    RpcClearPointsText();
                }
            }
            break;

        case InteractionMode.SpawnObjects:
            if (isLocalPlayer)
            {
                string last      = boxObject.Keys.Last();
                var    childName = GameObject.Find(last).transform.GetChild(0).name;
                DisplayBox(childName, true);
                radialMenu.RemoveLastObject();
                boxObject.Remove(last);
            }
            break;

        case InteractionMode.ScalePrefabs:
            if (!string.IsNullOrEmpty(ViveBridge.CollidedName))
            {
                var collided = GameObject.Find(ViveBridge.CollidedName);
                if (collided.transform.parent != null)
                {
                    collided = collided.transform.parent.gameObject;
                }

                collided.transform.localScale = collided.GetComponent <ScaleData>().WorldScale;
                RpcRestoreScale(collided);
            }
            break;
        }
    }