コード例 #1
0
 /// <summary>
 /// 英雄阵型进入待机
 /// </summary>
 public void SetHeroPathIdle()
 {
     if (Heropathtype != HeroPathMoveType.Idle)
     {
         Heropathtype = HeroPathMoveType.Idle;
         HeroPathAnim.Pause();
     }
 }
コード例 #2
0
    //=====================================================

    #region IPauseListener

    public void OnPauseEvent(bool isPaused)
    {
        _isPaused = isPaused;

        if (_cameraPathAnimator != null)
        {
            // Manage active fly-thru
            switch (_isPaused)
            {
            case true:
                _cameraPathAnimator.Pause();
                break;

            case false:
                _cameraPathAnimator.Play();
                break;
            }
            return;
        }

        if (_isCameraFollowingPath == false)
        {
            return;
        }

        // Manage active tween
        if (_isPaused == true && _tweenId != -1)
        {
            LeanTween.pause(_tweenId);
        }
        else if (_isPaused == false && _tweenId != -1)
        {
            LeanTween.resume(_tweenId);
        }
    }
コード例 #3
0
 public void btnPause()
 {
     if (cameraPath == null)
     {
         return;
     }
     cameraPath.Pause();
 }
コード例 #4
0
 public void TogglePlay()
 {
     if (CameraPath.isPlaying)
     {
         CameraPath.Pause();
     }
     else
     {
         CameraPath.Play();
     }
 }
コード例 #5
0
    private void Update()
    {
        if (Input.GetKeyUp(playBind))
        {
            pathAnimator.Play();
        }

        if (Input.GetKeyUp(pauseBind))
        {
            pathAnimator.Pause();
        }

        if (Input.GetKeyUp(stopBind))
        {
            pathAnimator.Stop();
        }

        if (Input.GetKeyUp(reverseBind))
        {
            if (pathAnimator.animationMode == CameraPathAnimator.animationModes.once)
            {
                pathAnimator.animationMode = CameraPathAnimator.animationModes.reverse;
            }
            else
            {
                pathAnimator.animationMode = CameraPathAnimator.animationModes.once;
            }
        }

        if (aniamtedCam != null)
        {
            if (Input.GetKey(zoomOutBind))
            {
                aniamtedCam.fieldOfView++;
            }

            if (Input.GetKey(zoomInBind))
            {
                aniamtedCam.fieldOfView--;
            }
        }

        if (Input.GetKey(speedUpBind))
        {
            pathAnimator.pathSpeed += Time.deltaTime;
        }

        if (Input.GetKey(slowDownBind))
        {
            pathAnimator.pathSpeed += -Time.deltaTime;
        }
    }
コード例 #6
0
ファイル: ICameraOperate.cs プロジェクト: 737871854/FireMen2
    public bool PauseCPA()
    {
        if (mCpa == null || !mCpa.isPlaying)
        {
            return(false);
        }

        mPercent = mCpa.percentage;
        mSpeed   = mCpa.pathSpeed;
        mCpa.Pause();
        mCpa.gameObject.SetActive(false);
        PauseMove = false;
        PauseRoll = true; // 暂时禁用
        return(true);
    }
コード例 #7
0
    void OnGUI()
    {
        if (pathAnimator == null)
        {
            return;
        }

        GUILayout.BeginVertical("Box", GUILayout.Width(250));

        GUILayout.BeginHorizontal();

        if (!pathAnimator.isPlaying)
        {
            if (GUILayout.Button("REPLAY", GUILayout.Width(70)))
            {
                if (pathAnimator.animationMode != CameraPathAnimator.animationModes.reverse)
                {
                    pathAnimator.Seek(0);
                }
                else
                {
                    pathAnimator.Seek(1);
                }
                pathAnimator.Play();
            }
        }
        else
        {
            if (GUILayout.Button("START", GUILayout.Width(70)))
            {
                pathAnimator.Play();
            }
            if (GUILayout.Button("PAUSE", GUILayout.Width(70)))
            {
                pathAnimator.Pause();
            }
            if (GUILayout.Button("STOP", GUILayout.Width(60)))
            {
                pathAnimator.Stop();
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Current Animation Percentage " + (pathAnimator.percentage * 100).ToString("F1") + "%", GUILayout.Width(150));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Path: " + pathAnimator.gameObject.name);
        if (GUILayout.Button("SWITCH", GUILayout.Width(70)))
        {
            pathAnimator.Stop();
            if (pathAnimator == pathAnimatorA)
            {
                pathAnimator = pathAnimatorB;
            }
            else
            {
                pathAnimator = pathAnimatorA;
            }
            pathAnimator.Play();
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Seek to Percent " + (seekTo * 100).ToString("F1") + "%", GUILayout.Width(150));
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        seekTo = GUILayout.HorizontalSlider(seekTo, 0, 1);
        if (GUILayout.Button("Seek", GUILayout.Width(40)))
        {
            pathAnimator.Stop();
            pathAnimator.Seek(seekTo);
            pathAnimator.Play();
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();

        GUILayout.BeginVertical();
        GUILayout.Label("Animation Mode:");
        GUILayout.Label(pathAnimator.animationMode.ToString());
        GUILayout.EndVertical();

        GUILayout.BeginVertical();
        GUILayout.Label("Orientation Mode:");
        GUILayout.Label(pathAnimator.orientationMode.ToString());
        GUILayout.EndVertical();

        GUILayout.EndHorizontal();


        GUILayout.BeginHorizontal();

        GUILayout.BeginVertical();
        if (GUILayout.Button("Forward"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.once;
        }
        if (GUILayout.Button("Reverse"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.reverse;
        }
        if (GUILayout.Button("Loop"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.loop;
        }
        if (GUILayout.Button("Reverse Loop"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.reverseLoop;
        }
        if (GUILayout.Button("Ping Pong"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.pingPong;
        }
        GUILayout.EndVertical();

        GUILayout.BeginVertical();
        if (GUILayout.Button("Custom"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.custom;
        }
        if (GUILayout.Button("Mouse look"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.mouselook;
        }
        if (GUILayout.Button("Follow Path"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.followpath;
        }
        if (GUILayout.Button("Reverse Follor Path"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.reverseFollowpath;
        }
        if (GUILayout.Button("CameraPathOnRailsTarget"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.target;
        }
        if (GUILayout.Button("Follow Transform"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.followTransform;
        }
        GUILayout.EndVertical();

        GUILayout.EndHorizontal();

        GUILayout.EndVertical();
    }
コード例 #8
0
 //动画暂停
 private void AnimPause()
 {
     CamPathAnim.Pause();
 }