示例#1
0
        protected virtual void FirstTimeSetup()
        {
            m_ClipTexts    = GetComponentsInChildren <ClipText>(true);
            m_CuboidLayout = GetComponentInChildren <CuboidLayout>(true);
            if (m_CuboidLayout)
            {
                m_CuboidLayout.UpdateObjects();
            }

            var handles = GetComponentsInChildren <BaseHandle>(true);

            foreach (var handle in handles)
            {
                // Ignore m_Cube for now (will be used for Reset action)
                if (handle.Equals(m_Cube))
                {
                    continue;
                }

                // Toggles can't be dragged
                if (handle.transform.parent.GetComponentInChildren <Toggle>())
                {
                    continue;
                }

                handle.pointerDown += OnPointerDown;
                handle.dragging    += OnDragging;
                handle.pointerUp   += OnPointerUp;
                handle.endDrag     += OnDragEnd;

                handle.dropHoverStarted += OnDropHoverStarted;
                handle.dropHoverEnded   += OnDropHoverEnded;

                handle.canDrop       = CanDrop;
                handle.receiveDrop   = ReceiveDrop;
                handle.getDropObject = GetDropObject;
            }

            m_InputFields = GetComponentsInChildren <InputField>(true);
        }