コード例 #1
0
    public static void ROTATE_OBJECT_PHY(MovableObject obj, Vector3 rotation)
    {
        CommandMovableObjectRotatePhysics cmd = mCommandSystem.newCmd <CommandMovableObjectRotatePhysics>(false, false);

        cmd.mName           = "";
        cmd.mOnceLength     = 0.0f;
        cmd.mStartRotation  = rotation;
        cmd.mTargetRotation = rotation;
        mCommandSystem.pushCommand(cmd, obj);
    }
コード例 #2
0
    public static CommandMovableObjectRotatePhysics ROTATE_OBJECT_PHY_DELAY(MovableObject obj, float delayTime, Vector3 rotation)
    {
        CommandMovableObjectRotatePhysics cmd = mCommandSystem.newCmd <CommandMovableObjectRotatePhysics>(false, true);

        cmd.mName           = "";
        cmd.mOnceLength     = 0.0f;
        cmd.mStartRotation  = rotation;
        cmd.mTargetRotation = rotation;
        mCommandSystem.pushDelayCommand(cmd, obj, delayTime);
        return(cmd);
    }
コード例 #3
0
    public static CommandMovableObjectRotatePhysics ROTATE_OBJECT_PHY_DELAY(MovableObject obj, float delayTime, string keyframe, Vector3 start, Vector3 target, float onceLength, bool loop, float offset)
    {
        if (keyframe == "" || MathUtility.isFloatZero(onceLength))
        {
            UnityUtility.logError("时间或关键帧不能为空,如果要停止组件,请使用CommandMovableObjectRotatePhysics ROTATE_OBJECT_PHY_DELAY(MovableObject obj, float delayTime, Vector3 rotation)");
        }
        CommandMovableObjectRotatePhysics cmd = mCommandSystem.newCmd <CommandMovableObjectRotatePhysics>(false, true);

        cmd.mName           = keyframe;
        cmd.mOnceLength     = onceLength;
        cmd.mStartRotation  = start;
        cmd.mTargetRotation = target;
        cmd.mOffset         = offset;
        cmd.mLoop           = loop;
        mCommandSystem.pushDelayCommand(cmd, obj, delayTime);
        return(cmd);
    }
コード例 #4
0
    public static void ROTATE_OBJECT_PHY_EX(MovableObject obj, string keyframe, Vector3 start, Vector3 target, float onceLength, bool loop, float offset, KeyFrameCallback rotatingCallback, KeyFrameCallback doneCallback)
    {
        if (keyframe == "" || MathUtility.isFloatZero(onceLength))
        {
            UnityUtility.logError("时间或关键帧不能为空,如果要停止组件,请使用void ROTATE_OBJECT_PHY(txUIObject obj, Vector3 rotation)");
        }
        CommandMovableObjectRotatePhysics cmd = mCommandSystem.newCmd <CommandMovableObjectRotatePhysics>(false, false);

        cmd.mName           = keyframe;
        cmd.mOnceLength     = onceLength;
        cmd.mStartRotation  = start;
        cmd.mTargetRotation = target;
        cmd.mOffset         = offset;
        cmd.mLoop           = loop;
        cmd.setTremblingCallback(rotatingCallback, null);
        cmd.setTrembleDoneCallback(doneCallback, null);
        mCommandSystem.pushCommand(cmd, obj);
    }