使用DoTweenPro插件实现场景漫游功能(摄像机按照指定轨迹移动)
发布日期:2021-05-10 09:22:38 浏览次数:19 分类:精选文章

本文共 2716 字,大约阅读时间需要 9 分钟。

#Unity���������������������������������������������

������������������

���Unity������������������������������������������������������������������

  • ������DoTweenPro������

    ������������������������DoTweenPro���������������������������������������

  • ������������������

    ���������������UI���������������������������������������������������������

  • ������������������

    ���������������������������������������������������������������������������������������������position���rotation������

  • ������������������������������������

    1. ������DoTweenPath������

  • ������������������

    ������������������������������������������������������������scene���������������������������������Camera.main���������������������������

  • ������DoTweenPath������

    ������Inspector���DOTweenPath���������������������������������������

  • 2. ���������������

  • ���������������
    • ������Ctrl���Shift������������������������������������������������������������������������������������������������
    • ������������������������������������������������������������������
  • 3. ������DoTweenPath������

  • ������������������
    • AutoPlay������������������false���������������������������������������������������������������������������
  • ������������������������������

    1. ������������CameraControl

    using System.Collections;
    using DG.Tweening;
    using UnityEngine;
    public class CameraControl : MonoBehaviour
    {
    private Camera _mainCamera;
    private DOTweenPath _dotweenPath;
    public void DoplayAutoMoveCamera()
    {
    if (_dotweenPath != null)
    {
    _dotweenPath.DOPlay();
    }
    }
    public void DoPauseAutoMoveCamera()
    {
    if (_dotweenPath != null)
    {
    _dotweenPath.DOPause();
    }
    }
    public void DoTogglePauseAutoMoveCamera()
    {
    if (_dotweenPath != null)
    {
    _dotweenPath.DOTogglePause();
    }
    }
    }

    2. ������������������

    • DoplayAutoMoveCamera������������������������
    • DoPauseAutoMoveCamera������������������������
    • DoTogglePauseAutoMoveCamera������������������������������/������������

    ������������������

  • ���������������������������������Scripts������������
  • ���������������������������������������������������������������������������
  • ������������������

    ������������������������������������

  • ���������������������������������������������
  • ������������������������������������������������������
  • ���������������������������������������������������������
  • ������������������

  • ���������������

    ������������������������������������������������������������������������������������������

  • ������������

    • ������������������������������������������
    • ���������������������������������������������������������������������
  • ������������

    ���������������������������������������������������������������������

  • 上一篇:Unity实现通用的显示或隐藏多个物体(同时实现脚本自动创建物体且给创建物体添加脚本自己)
    下一篇:Unity3D 控制物体移动、旋转、缩放

    发表评论

    最新留言

    感谢大佬
    [***.8.128.20]2025年04月01日 08时45分18秒