示例#1
0
    private void OnSelectionChange()
    {
        List <ISelectable> currentSelection = SelectionManager.CurrentSelection;

        if (currentSelection.Count > 0)
        {
            Transform targetItem = SelectionManager.GetTargetItem();
            if (targetItem == null)
            {
                return;
            }

            if (SelectionManager.GetSelectionType() == SelectableType.Santa)
            {
                commandUI.Show();
                CameraController.Instance.OrbitCamera.SetTarget(targetItem);
            }

            if (currentSelection.Count == 1)
            {
                ISelectable selectable = currentSelection[0];
                giftSelectionUI.SetSelectable(selectable);
                giftSelectionUI.Show();
            }
        }
        else
        {
            commandUI.Hide();
            giftSelectionUI.Hide();
        }
    }