123456789101112131415161718192021222324252627282930313233 |
- using DG.Tweening;
- using UnityEngine;
- namespace ET.Client
- {
- [FriendOfAttribute(typeof(ET.Client.GlobalViewComponent))]
- public static class CameraMgr
- {
- //相机跟随主角
- public static void FollowMe(Vector3 pos)
- {
- var camera = Camera.main;
- pos.y = 7;
- pos.z -= 15;
- camera.transform.position = pos;
- }
- private static bool bShaking = false;
- public static void ShakeMe(float shakeTime, Vector3 shakeStength)
- {
- if (bShaking) return;
- bShaking = true;
- Transform trans = GlobalViewComponent.Instance.BattleCamera.transform;
- Tweener tweener = trans.DOShakePosition(shakeTime, shakeStength);
- tweener.OnComplete<Tweener>(() =>
- {
- trans.localPosition = Vector3.zero;
- bShaking = false;
- });
- }
- }
- }
|