Beispiel #1
0
    public void doneRotateCallback(RotateToTargetCallback curDoneCallback, object curDoneUserData, ComponentRotateToTarget component)
    {
        // 先保存回调,然后再调用回调之前就清空回调,确保在回调函数执行时已经完全完成
        RotateToTargetCallback rotateCallback = curDoneCallback;
        object tempUserData = curDoneUserData;

        clearCallback();
        if (rotateCallback != null)
        {
            rotateCallback(component, tempUserData, false, true);
        }
    }
Beispiel #2
0
    public void setRotateCallback(RotateToTargetCallback callback, object userData, ref RotateToTargetCallback curCallback, ref object curUserData, ComponentRotateToTarget component)
    {
        RotateToTargetCallback rotateCallback = curCallback;
        object tempUserData = curUserData;

        curCallback = null;
        curUserData = null;
        // 如果回调函数当前不为空,则是中断了正在进行的变化
        if (rotateCallback != null)
        {
            rotateCallback(component, tempUserData, true, false);
        }
        curCallback = callback;
        curUserData = userData;
    }