0.3.4.9
This commit is contained in:
parent
4c46b87a95
commit
ecd28edebe
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96dece0244fff8e4b9662917d4827a9e
|
||||
guid: d87e8c32f782ca846bb8f2c48fc8d16c
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
15
Assets/02.Scripts/ShaderUnscaledTime.cs
Normal file
15
Assets/02.Scripts/ShaderUnscaledTime.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ShaderUnscaledTime : MonoBehaviour
|
||||
{
|
||||
public Material material; // 쉐이더가 포함된 Material
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (material != null)
|
||||
{
|
||||
// 사용자 정의 변수 "_CustomTime"에 unscaledTime 값 전달
|
||||
material.SetFloat("_CustomTime", Time.unscaledTime);
|
||||
}
|
||||
}
|
||||
}
|
2
Assets/02.Scripts/ShaderUnscaledTime.cs.meta
Normal file
2
Assets/02.Scripts/ShaderUnscaledTime.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf906d99280c73d45a290761969d7bc5
|
@ -107,82 +107,70 @@ namespace BlueWater.Uis
|
||||
// ReSharper disable Unity.PerformanceAnalysis
|
||||
private IEnumerator SelectedAnimation(TycoonCard currentTycoonCard)
|
||||
{
|
||||
Vector2 startPosition01 = default; //시작 위치
|
||||
Vector2 endPosition01 = default; // 목표 위치
|
||||
|
||||
Vector2 startPosition02 = default; //시작 위치
|
||||
Vector2 endPosition02 = default; // 목표 위치
|
||||
Vector3 startScale01 = default; //시작 위치
|
||||
Vector3 startScale02 = default; //시작 위치
|
||||
Vector3 startScale03 = default; //시작 위치
|
||||
|
||||
Vector2 startPosition03 = default; //시작 위치
|
||||
Vector2 endPosition03 = default; //목표 위치
|
||||
|
||||
RectTransform rect01 = null;
|
||||
RectTransform rect02 = null;
|
||||
RectTransform rect03 = null;
|
||||
|
||||
rect03 = currentTycoonCard.RectTransform;
|
||||
startPosition03 = rect03.anchoredPosition;
|
||||
endPosition03 = new Vector2(0.0f, 0.0f);
|
||||
|
||||
|
||||
// 화면의 해상도를 가져옴
|
||||
if (currentTycoonCard == _tycoonCards[0]) //우우
|
||||
{
|
||||
rect01 = _tycoonCards[0].RectTransform;
|
||||
startPosition01 = rect01.anchoredPosition; // 시작 위치
|
||||
endPosition01 = new Vector2(Screen.width + 1500, startPosition01.y); // 목표 위치(좌측)
|
||||
|
||||
rect01 = _tycoonCards[1].RectTransform;
|
||||
rect02 = _tycoonCards[2].RectTransform;
|
||||
startPosition02 = rect02.anchoredPosition; // 시작 위치
|
||||
endPosition02 = new Vector2(Screen.width + 1500, startPosition02.y); // 목표 위치(좌측)
|
||||
rect03 = _tycoonCards[0].RectTransform;
|
||||
}
|
||||
else if (currentTycoonCard == _tycoonCards[1]) //좌우
|
||||
{
|
||||
rect01 = _tycoonCards[1].RectTransform;
|
||||
startPosition01 = rect01.anchoredPosition; // 시작 위치
|
||||
endPosition01 = new Vector2(-1500, startPosition01.y); // 목표 위치(좌측)
|
||||
|
||||
rect01 = _tycoonCards[0].RectTransform;
|
||||
rect02 = _tycoonCards[2].RectTransform;
|
||||
startPosition02 = rect02.anchoredPosition; // 시작 위치
|
||||
endPosition02 = new Vector2(Screen.width + 1500, startPosition02.y); // 목표 위치(좌측)
|
||||
rect03 = _tycoonCards[1].RectTransform;
|
||||
}
|
||||
else if (currentTycoonCard == _tycoonCards[2]) //좌좌
|
||||
{
|
||||
rect01 = _tycoonCards[0].RectTransform;
|
||||
startPosition01 = rect01.anchoredPosition; // 시작 위치
|
||||
endPosition01 = new Vector2(-1500, startPosition01.y); // 목표 위치(좌측)
|
||||
|
||||
rect02 = _tycoonCards[1].RectTransform;
|
||||
startPosition02 = rect02.anchoredPosition; // 시작 위치
|
||||
endPosition02 = new Vector2(-1500, startPosition02.y); // 목표 위치(좌측)
|
||||
rect03 = _tycoonCards[2].RectTransform;
|
||||
}
|
||||
|
||||
rect03.localScale = new Vector3(1.5f, 1.5f, 1.5f);
|
||||
|
||||
startScale01 = rect01.localScale; // 시작 위치
|
||||
startScale02 = rect02.localScale; // 시작 위치
|
||||
startScale03 = rect03.localScale; // 시작 위치
|
||||
|
||||
|
||||
float time = 0.0f; // 타이머 초기화
|
||||
int rotationDirection = Random.Range(0, 2) * 2 - 1; // 결과는 -1 또는 1
|
||||
|
||||
while (time < 1.0f)
|
||||
{
|
||||
time += Time.unscaledDeltaTime; // 시간 업데이트
|
||||
float t = EaseEffect.ExpoOut((time / 1.0f)); // 정규화된 시간
|
||||
|
||||
//캐릭터의 위치 반환 (실시간으로 움직이기 때문에... 계속 업데이트하면서 가져오기.)
|
||||
|
||||
// 위치 업데이트
|
||||
rect01.anchoredPosition = Vector2.Lerp(startPosition01, endPosition01, t);
|
||||
rect02.anchoredPosition = Vector2.Lerp(startPosition02, endPosition02, t);
|
||||
|
||||
// 선형 보간을 사용하여 위치와 크기 조정
|
||||
rect03.anchoredPosition = Vector2.Lerp(startPosition03, endPosition03, EaseEffect.ExpoOut((time / 1.0f) + 1.0f)); // 정규화된 시간
|
||||
rect03.localScale = Vector3.Lerp(Vector3.one, Vector3.zero, t);
|
||||
float _Time = time / 0.5f;
|
||||
float easedTOut = EaseEffect.ExpoOut(_Time);
|
||||
|
||||
// 포물선 효과 추가
|
||||
float height = Mathf.Sin(Mathf.PI * t) * 500f; // 높이
|
||||
float width = Mathf.Sin(Mathf.PI * t) * 200f * rotationDirection; // 폭
|
||||
rect03.anchoredPosition += new Vector2(width, height);
|
||||
rect01.localScale = Vector3.Lerp(startScale01, new Vector3(0.0f, 0.0f, 0.0f), easedTOut);
|
||||
rect02.localScale = Vector3.Lerp(startScale02, new Vector3(0.0f, 0.0f, 0.0f), easedTOut);
|
||||
rect03.localScale = Vector3.Lerp(startScale03, new Vector3(1.0f, 1.0f, 1.0f), easedTOut);
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// Z축 회전 추가
|
||||
float rotationAngle = 15f * rotationDirection * t; // 최대 15도 회전
|
||||
rect03.rotation = Quaternion.Euler(new Vector3(0, 0, rotationAngle));
|
||||
time = 0.0f; // 타이머 초기화
|
||||
startScale03 = rect03.localScale; // 시작 위치
|
||||
|
||||
while (time < 1.0f)
|
||||
{
|
||||
time += Time.unscaledDeltaTime; // 시간 업데이트
|
||||
|
||||
float _Time = time / 0.5f;
|
||||
|
||||
float easedTIn = EaseEffect.ExpoIn(_Time);
|
||||
rect03.localScale = Vector3.Lerp(startScale03, new Vector3(0.0f, 0.0f, 0.0f), easedTIn);
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
@ -93,6 +93,7 @@ Material:
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _CustomTime: 70.406334
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
@ -104,9 +105,9 @@ Material:
|
||||
- _GlossyReflections: 0
|
||||
- _Metallic: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Opacity: 0.89
|
||||
- _Opacity: 1
|
||||
- _Parallax: 0.005
|
||||
- _Position: 0.38
|
||||
- _Position: 0.395
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _ShadeContrast: 0
|
||||
@ -117,7 +118,7 @@ Material:
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _Time: 0
|
||||
- _Time: 0.019554103
|
||||
- _WorkflowMode: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
|
@ -7,7 +7,7 @@ Shader "Unlit/Ink"
|
||||
_Speed("Speed", Float) = 0.1175
|
||||
_ShadeContrast("Shade Contrast", Float) = 0.11
|
||||
_Resolution("Resolution", Vector) = (1920, 1080, 0, 0)
|
||||
_Time("Time", Float) = 0
|
||||
_CustomTime("Time", Float) = 0
|
||||
_Position("Position" , Range(0, 1)) = 0.1
|
||||
_Opacity("Opacity" , Range(0, 1)) = 1.0
|
||||
}
|
||||
@ -35,6 +35,7 @@ Shader "Unlit/Ink"
|
||||
float _ShadeContrast;
|
||||
float4 _Resolution;
|
||||
float _Opacity;
|
||||
float _CustomTime;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
@ -124,7 +125,10 @@ Shader "Unlit/Ink"
|
||||
float mappedFloat = lerp(-4.0, 1.5, _Position);
|
||||
uv.x = uv.x * 3.5 + mappedFloat;
|
||||
|
||||
float3 p = float3(uv, _Time.y * _Speed);
|
||||
float timeValue = _CustomTime * _Speed; // 시간 값
|
||||
|
||||
// 명시적으로 float3 생성
|
||||
float3 p = float3(uv.x, uv.y, timeValue);
|
||||
|
||||
float blot = fbm(p * 2.0 + 4.0) - 0.1;
|
||||
float shade = fbm(p * 3.0 + 16.0) - 0.2;
|
||||
|
Loading…
Reference in New Issue
Block a user