常用功能------镜头漫游动画

1、镜头漫游
我用的是CameraPathCreator插件,将预制件path拖到场景中设置调整就可以使用了。
在这里插入图片描述
2、测试
在这里插入图片描述

/*****************************************************************
 *UnityVersion: 2020.3.1f1
 *Function: 
 *******************************************************************/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Ceshi
{
    
    
    /// <summary>
    /// 
    /// </summary>
    public class CameraAniTest : MonoBehaviour
    {
    
    
        public GameObject CameraPath;
        // Start is called before the first frame update
        void Start()
        {
    
    

        }

        // Update is called once per frame
        void Update()
        {
    
    
            //判断是否播放漫游完成
            if (CameraPath.GetComponent<CPC_CameraPath>().IsPaused() == false)
            {
    
    
                if (CameraPath.GetComponent<CPC_CameraPath>().IsPlaying() == false)
                {
    
    
                    //漫游结束后执行的方法
                    Debug.Log("摄像机漫游结束,执行结束后的方法");
                }
            }
        }
    }
}

3、结果
摄像机在规定的时间内执行规划好的路径动画,完成后执行指定的输出语句。
在这里插入图片描述

![在这里插入图片描述](https://img-blog.csdnimg.cn/cea97f4da7124462b078f765157be4fc.gif#pic_center
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_37179591/article/details/122156654
今日推荐