Пример #1
0
    public void OnDragStart(BaseEventData data)
    {
        var pointerData = data as PointerEventData;

        if (m_tempTransition != null)
        {
            Destroy(m_tempTransition.gameObject);
        }
        m_tempTransition = Instantiate(TransitionPrefab).GetComponent <TransitionElement>();
        m_tempTransition.transform.SetParent(transform);
        m_tempTransition.transform.localPosition = Vector3.zero;
        m_tempTransition.transform.localScale    = Vector3.one;
        m_tempTransition.gameObject.SetActive(true);
        m_tempTransition.SetData(State, null, null);
    }
Пример #2
0
    public void EndDrag(BaseEventData data)
    {
        m_isDragging = false;
        var pointerData = data as PointerEventData;
        var node        = pointerData.pointerCurrentRaycast.gameObject.GetComponent <EntryNode>();

        if (node == null)
        {
            NextState = null;
            Destroy(m_tempTransition.gameObject);
            m_tempTransition = null;
            return;
        }
        NextState = node.State;
        if (NextState.GUID == State.GUID)
        {
            NextState = null;
        }
        TransitionNodes.Add(m_tempTransition);
        m_tempTransition.SetData(State, node, UiManager.LevelInstance.CurrentFile.DefaultTransition());
        m_tempTransition = null;
    }