示例#1
0
    /// <summary>
    /// Automatically find the draggable camera if possible.
    /// </summary>
    void Awake()
    {
        // Legacy functionality support for backwards compatibility
        if (target != null)
        {
            if (draggableCamera == null)
            {
                draggableCamera = target.GetComponent<NGUIDraggableCamera>();

                if (draggableCamera == null)
                {
                    draggableCamera = target.gameObject.AddComponent<NGUIDraggableCamera>();
                }
            }
            target = null;
        }
        else if (draggableCamera == null)
        {
            draggableCamera = NGUITools.FindInParents<NGUIDraggableCamera>(gameObject);
        }
    }
示例#2
0
    /// <summary>
    /// Automatically find the draggable camera if possible.
    /// </summary>

    void Awake()
    {
        // Legacy functionality support for backwards compatibility
        if (target != null)
        {
            if (draggableCamera == null)
            {
                draggableCamera = target.GetComponent <NGUIDraggableCamera>();

                if (draggableCamera == null)
                {
                    draggableCamera = target.gameObject.AddComponent <NGUIDraggableCamera>();
                }
            }
            target = null;
        }
        else if (draggableCamera == null)
        {
            draggableCamera = NGUITools.FindInParents <NGUIDraggableCamera>(gameObject);
        }
    }