From af519d2ffe9c845ef99d113b1731e4a48816df58 Mon Sep 17 00:00:00 2001 From: Cat Flynn Date: Wed, 17 Mar 2021 18:37:56 +0000 Subject: [PATCH] pop-in animation on platform respawn --- game/Assets/Scripts/Traps/FallawayFloor.cs | 6 ++++++ game/Assets/Scripts/Traps/TrapSettings.cs | 4 ++++ game/Assets/Settings/Traps/Trap Settings.asset | 1 + 3 files changed, 11 insertions(+) diff --git a/game/Assets/Scripts/Traps/FallawayFloor.cs b/game/Assets/Scripts/Traps/FallawayFloor.cs index d1f205a..683b716 100644 --- a/game/Assets/Scripts/Traps/FallawayFloor.cs +++ b/game/Assets/Scripts/Traps/FallawayFloor.cs @@ -37,6 +37,12 @@ public class FallawayFloor : MonoBehaviour if (_settings.FallawayFloor.CanRespawn) { Reset(); + + // pop in animation + transform.localScale = Vector3.zero; + transform + .DOScale(Vector3.one, 0.5f) + .SetEase(_settings.FallawayFloor.PopInEase); } } diff --git a/game/Assets/Scripts/Traps/TrapSettings.cs b/game/Assets/Scripts/Traps/TrapSettings.cs index dfc3175..3179611 100644 --- a/game/Assets/Scripts/Traps/TrapSettings.cs +++ b/game/Assets/Scripts/Traps/TrapSettings.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using DG.Tweening; using Ktyl.Util; using UnityEngine; @@ -24,6 +25,9 @@ public class TrapSettings : ScriptableObject public float ShakeStrength => _shakeStrength; [Header("Animation")] [SerializeField] private float _shakeStrength; + + public Ease PopInEase => _popInEase; + [SerializeField] private Ease _popInEase; } public FallawayFloorSettings FallawayFloor => _fallawayFloor; [SerializeField] private FallawayFloorSettings _fallawayFloor; diff --git a/game/Assets/Settings/Traps/Trap Settings.asset b/game/Assets/Settings/Traps/Trap Settings.asset index 5b3afb8..5f04d47 100644 --- a/game/Assets/Settings/Traps/Trap Settings.asset +++ b/game/Assets/Settings/Traps/Trap Settings.asset @@ -17,3 +17,4 @@ MonoBehaviour: _respawnTime: {fileID: 11400000, guid: 1d2951ab5083d4d48a319ff00a9eb8bd, type: 2} _safeTime: {fileID: 11400000, guid: 27c10a061baeec8469e96d4f995c1445, type: 2} _shakeStrength: 0.1 + _popInEase: 27