Ejemplo n.º 1
0
        void Start()
        {
            if (!this.IsSharedUpdater(this))
            {
                return;
            }

            m_PivotModeToggleAction.execute = TogglePivotMode;
            UpdatePivotModeAction();
            m_PivotRotationToggleAction.execute = TogglePivotRotation;
            UpdatePivotRotationAction();
            m_ManipulatorToggleAction.execute = ToggleManipulator;
            UpdateManipulatorAction();

            // Add standard and scale manipulator prefabs to a list (because you cannot add asset references directly to a serialized list)
            if (m_StandardManipulatorPrefab != null)
            {
                m_StandardManipulator = CreateManipulator(m_StandardManipulatorPrefab);
            }

            if (m_ScaleManipulatorPrefab != null)
            {
                m_ScaleManipulator = CreateManipulator(m_ScaleManipulatorPrefab);
            }

            m_CurrentManipulator = m_StandardManipulator;

            InputUtils.GetBindingDictionaryFromActionMap(m_ActionMap, m_Controls);

            this.SubscribeToResetDirectSelectionState(OnResetDirectSelectionState);
        }
Ejemplo n.º 2
0
        void Start()
        {
            if (!this.IsSharedUpdater(this))
            {
                return;
            }

            m_PivotModeToggleAction.execute = TogglePivotMode;
            UpdatePivotModeAction();
            m_PivotRotationToggleAction.execute = TogglePivotRotation;
            UpdatePivotRotationAction();
            m_ManipulatorToggleAction.execute = ToggleManipulator;
            UpdateManipulatorAction();

            // Add standard and scale manipulator prefabs to a list (because you cannot add asset references directly to a serialized list)
            if (m_StandardManipulatorPrefab != null)
            {
                m_StandardManipulator = CreateManipulator(m_StandardManipulatorPrefab);
            }

            if (m_ScaleManipulatorPrefab != null)
            {
                m_ScaleManipulator = CreateManipulator(m_ScaleManipulatorPrefab);
            }

            m_CurrentManipulator = m_StandardManipulator;
        }
Ejemplo n.º 3
0
        bool ToggleManipulator()
        {
            m_CurrentManipulator.gameObject.SetActive(false);

            m_CurrentManipulator = m_CurrentManipulator == m_StandardManipulator ? m_ScaleManipulator : m_StandardManipulator;
            UpdateManipulatorAction();
            UpdateCurrentManipulator();
            return(true);
        }
Ejemplo n.º 4
0
    void Awake()
    {
#if UNITY_EDITOR
        m_PivotModeToggleAction.execute = TogglePivotMode;
        UpdatePivotModeToggleIcon();
        m_PivotRotationToggleAction.execute = TogglePivotRotation;
        UpdatePivotRotationToggleIcon();
        m_ManipulatorToggleAction.execute = ToggleManipulator;
        UpdateManipulatorToggleIcon();
#endif

        // Add standard and scale manipulator prefabs to a list (because you cannot add asset references directly to a serialized list)
        if (m_StandardManipulatorPrefab != null)
        {
            m_StandardManipulator = CreateManipulator(m_StandardManipulatorPrefab);
        }

        if (m_ScaleManipulatorPrefab != null)
        {
            m_ScaleManipulator = CreateManipulator(m_ScaleManipulatorPrefab);
        }

        m_CurrentManipulator = m_StandardManipulator;
    }