12345678910111213141516171819202122232425262728293031323334353637 |
- using ChivaXR;
- using Sirenix.OdinInspector;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class AniDriver_CameraLocation : AnimationDriverBase
- {
- [LabelText("需要移动对象")]
- public Transform moveObj;
- [LabelText("移动路径点")]
- public List<Transform> pathPoints = new List<Transform>();
- private Vector3 initPos;
- private Quaternion initRotation;
- public override void FinishedState()
- {
- moveObj.transform.position = pathPoints[pathPoints.Count - 1].position;
- moveObj.transform.rotation = pathPoints[pathPoints.Count - 1].rotation;
- }
- public override void InitState()
- {
- moveObj.transform.position = pathPoints[0].position;
- moveObj.transform.rotation = pathPoints[0].rotation;
- }
- public override void StartPlay(Action finishedCallBack = null)
- {
- moveObj.transform.position = pathPoints[pathPoints.Count - 1].position;
- moveObj.transform.rotation = pathPoints[pathPoints.Count - 1].rotation;
- finishedCallBack?.Invoke();
- }
- }
|