Exemple #1
0
        private void Update()
        {
            float deltaAngle = 360 / Mathf.Max(Objects.Length, 1);

            if (Input.GetKeyDown(KeyCode.LeftArrow))
            {
                m_targetAngle   -= deltaAngle;
                m_targetRotation = Quaternion.Euler(0, m_targetAngle, 0);
                m_index--;
            }
            else if (Input.GetKeyDown(KeyCode.RightArrow))
            {
                m_targetAngle   += deltaAngle;
                m_targetRotation = Quaternion.Euler(0, m_targetAngle, 0);
                m_index++;
            }

            if (m_index < 0)
            {
                m_index = Objects.Length - 1;
            }
            else if (m_index >= Objects.Length)
            {
                m_index = 0;
            }

            BaseGizmo gizmo = Objects[m_index].GetComponentInChildren <BaseGizmo>();

            Text.text = gizmo.GetType().Name;
        }
Exemple #2
0
        protected virtual void Start()
        {
            if (m_gizmo == null)
            {
                m_gizmo = GetComponent <BaseGizmo>();
            }

            if (m_editor == null)
            {
                if (m_gizmo != null)
                {
                    m_editor = m_gizmo.Editor;
                }
            }
        }
        private void OnEnable()
        {
            if (m_gizmo == null)
            {
                m_gizmo = GetComponent <BaseGizmo>();
            }

            m_editor = m_gizmo.Editor;

            if (m_editor != null)
            {
                if (BeginDragAction())
                {
                    m_gizmo.BeginDrag();
                }
            }
        }