DoTween Animation Unity 2024 || DoTween

Описание к видео DoTween Animation Unity 2024 || DoTween

🎥 Dive into the world of Unity with this comprehensive tutorial on Dotween! 🚀 Whether you're a beginner or an experienced developer, this video will guide you through the ins and outs of using Dotween in Unity to create smooth and dynamic animations for your games and projects. 🎮 Learn how to implement tweens, easing functions, and more to bring your creations to life! 💡 #UnityTutorial #Dotween #GameDevelopment #Animation #UnityTips 🌟
Script: 👇👇👇👇👇👇
sing System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using System.Threading.Tasks;

public class DoTweenManager : MonoBehaviour
{
// Start is called before the first frame update
public GameObject _pausePanel;
public RectTransform _pauseRectTransform;
public float _topYpos, _midYpos,duration;

public void OnPauseButton()
{
_pausePanel.SetActive(true);
PausePanelIn();
}


public async void OnResumeButton()
{
await Pauseout();
_pausePanel.SetActive(false);

}
void PausePanelIn()
{
_pauseRectTransform.DOAnchorPosY(_midYpos, duration).SetUpdate(true);
}
async Task Pauseout()
{
await _pauseRectTransform.DOAnchorPosY(_topYpos, duration).SetUpdate(true).AsyncWaitForCompletion();
}
}

Комментарии

Информация по комментариям в разработке