This commit is contained in:
NTG_Lenovo 2024-11-19 15:58:29 +09:00
commit e3bd934991
7 changed files with 10437 additions and 18111 deletions

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 96dece0244fff8e4b9662917d4827a9e guid: d87e8c32f782ca846bb8f2c48fc8d16c
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View 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);
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bf906d99280c73d45a290761969d7bc5

View File

@ -107,82 +107,70 @@ namespace BlueWater.Uis
// ReSharper disable Unity.PerformanceAnalysis // ReSharper disable Unity.PerformanceAnalysis
private IEnumerator SelectedAnimation(TycoonCard currentTycoonCard) private IEnumerator SelectedAnimation(TycoonCard currentTycoonCard)
{ {
Vector2 startPosition01 = default; //시작 위치 Vector3 startScale01 = default; //시작 위치
Vector2 endPosition01 = default; // 목표 위치 Vector3 startScale02 = default; //시작 위치
Vector3 startScale03 = default; //시작 위치
Vector2 startPosition02 = default; //시작 위치
Vector2 endPosition02 = default; // 목표 위치
Vector2 startPosition03 = default; //시작 위치
Vector2 endPosition03 = default; //목표 위치
RectTransform rect01 = null; RectTransform rect01 = null;
RectTransform rect02 = null; RectTransform rect02 = null;
RectTransform rect03 = null; RectTransform rect03 = null;
rect03 = currentTycoonCard.RectTransform;
startPosition03 = rect03.anchoredPosition;
endPosition03 = new Vector2(0.0f, 0.0f);
// 화면의 해상도를 가져옴 // 화면의 해상도를 가져옴
if (currentTycoonCard == _tycoonCards[0]) //우우 if (currentTycoonCard == _tycoonCards[0]) //우우
{ {
rect01 = _tycoonCards[0].RectTransform; rect01 = _tycoonCards[1].RectTransform;
startPosition01 = rect01.anchoredPosition; // 시작 위치
endPosition01 = new Vector2(Screen.width + 1500, startPosition01.y); // 목표 위치(좌측)
rect02 = _tycoonCards[2].RectTransform; rect02 = _tycoonCards[2].RectTransform;
startPosition02 = rect02.anchoredPosition; // 시작 위치 rect03 = _tycoonCards[0].RectTransform;
endPosition02 = new Vector2(Screen.width + 1500, startPosition02.y); // 목표 위치(좌측)
} }
else if (currentTycoonCard == _tycoonCards[1]) //좌우 else if (currentTycoonCard == _tycoonCards[1]) //좌우
{ {
rect01 = _tycoonCards[1].RectTransform; rect01 = _tycoonCards[0].RectTransform;
startPosition01 = rect01.anchoredPosition; // 시작 위치
endPosition01 = new Vector2(-1500, startPosition01.y); // 목표 위치(좌측)
rect02 = _tycoonCards[2].RectTransform; rect02 = _tycoonCards[2].RectTransform;
startPosition02 = rect02.anchoredPosition; // 시작 위치 rect03 = _tycoonCards[1].RectTransform;
endPosition02 = new Vector2(Screen.width + 1500, startPosition02.y); // 목표 위치(좌측)
} }
else if (currentTycoonCard == _tycoonCards[2]) //좌좌 else if (currentTycoonCard == _tycoonCards[2]) //좌좌
{ {
rect01 = _tycoonCards[0].RectTransform; rect01 = _tycoonCards[0].RectTransform;
startPosition01 = rect01.anchoredPosition; // 시작 위치
endPosition01 = new Vector2(-1500, startPosition01.y); // 목표 위치(좌측)
rect02 = _tycoonCards[1].RectTransform; rect02 = _tycoonCards[1].RectTransform;
startPosition02 = rect02.anchoredPosition; // 시작 위치 rect03 = _tycoonCards[2].RectTransform;
endPosition02 = new Vector2(-1500, startPosition02.y); // 목표 위치(좌측)
} }
rect03.localScale = new Vector3(1.5f, 1.5f, 1.5f);
startScale01 = rect01.localScale; // 시작 위치
startScale02 = rect02.localScale; // 시작 위치
startScale03 = rect03.localScale; // 시작 위치
float time = 0.0f; // 타이머 초기화 float time = 0.0f; // 타이머 초기화
int rotationDirection = Random.Range(0, 2) * 2 - 1; // 결과는 -1 또는 1
while (time < 1.0f) while (time < 1.0f)
{ {
time += Time.unscaledDeltaTime; // 시간 업데이트 time += Time.unscaledDeltaTime; // 시간 업데이트
float t = EaseEffect.ExpoOut((time / 1.0f)); // 정규화된 시간
//캐릭터의 위치 반환 (실시간으로 움직이기 때문에... 계속 업데이트하면서 가져오기.) //캐릭터의 위치 반환 (실시간으로 움직이기 때문에... 계속 업데이트하면서 가져오기.)
// 위치 업데이트 float _Time = time / 0.5f;
rect01.anchoredPosition = Vector2.Lerp(startPosition01, endPosition01, t); float easedTOut = EaseEffect.ExpoOut(_Time);
rect02.anchoredPosition = Vector2.Lerp(startPosition02, endPosition02, t);
// 선형 보간을 사용하여 위치와 크기 조정 rect01.localScale = Vector3.Lerp(startScale01, new Vector3(0.0f, 0.0f, 0.0f), easedTOut);
rect03.anchoredPosition = Vector2.Lerp(startPosition03, endPosition03, EaseEffect.ExpoOut((time / 1.0f) + 1.0f)); // 정규화된 시간 rect02.localScale = Vector3.Lerp(startScale02, new Vector3(0.0f, 0.0f, 0.0f), easedTOut);
rect03.localScale = Vector3.Lerp(Vector3.one, Vector3.zero, t); rect03.localScale = Vector3.Lerp(startScale03, new Vector3(1.0f, 1.0f, 1.0f), easedTOut);
// 포물선 효과 추가 yield return null;
float height = Mathf.Sin(Mathf.PI * t) * 500f; // 높이 }
float width = Mathf.Sin(Mathf.PI * t) * 200f * rotationDirection; // 폭
rect03.anchoredPosition += new Vector2(width, height);
// Z축 회전 추가 time = 0.0f; // 타이머 초기화
float rotationAngle = 15f * rotationDirection * t; // 최대 15도 회전 startScale03 = rect03.localScale; // 시작 위치
rect03.rotation = Quaternion.Euler(new Vector3(0, 0, rotationAngle));
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; yield return null;
} }

View File

@ -93,6 +93,7 @@ Material:
- _ClearCoatMask: 0 - _ClearCoatMask: 0
- _ClearCoatSmoothness: 0 - _ClearCoatSmoothness: 0
- _Cull: 2 - _Cull: 2
- _CustomTime: 70.406334
- _Cutoff: 0.5 - _Cutoff: 0.5
- _DetailAlbedoMapScale: 1 - _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1 - _DetailNormalMapScale: 1
@ -104,9 +105,9 @@ Material:
- _GlossyReflections: 0 - _GlossyReflections: 0
- _Metallic: 0 - _Metallic: 0
- _OcclusionStrength: 1 - _OcclusionStrength: 1
- _Opacity: 0.89 - _Opacity: 1
- _Parallax: 0.005 - _Parallax: 0.005
- _Position: 0.38 - _Position: 0.395
- _QueueOffset: 0 - _QueueOffset: 0
- _ReceiveShadows: 1 - _ReceiveShadows: 1
- _ShadeContrast: 0 - _ShadeContrast: 0
@ -117,7 +118,7 @@ Material:
- _SrcBlend: 1 - _SrcBlend: 1
- _SrcBlendAlpha: 1 - _SrcBlendAlpha: 1
- _Surface: 0 - _Surface: 0
- _Time: 0 - _Time: 0.019554103
- _WorkflowMode: 1 - _WorkflowMode: 1
- _ZWrite: 1 - _ZWrite: 1
m_Colors: m_Colors:

View File

@ -7,7 +7,7 @@ Shader "Unlit/Ink"
_Speed("Speed", Float) = 0.1175 _Speed("Speed", Float) = 0.1175
_ShadeContrast("Shade Contrast", Float) = 0.11 _ShadeContrast("Shade Contrast", Float) = 0.11
_Resolution("Resolution", Vector) = (1920, 1080, 0, 0) _Resolution("Resolution", Vector) = (1920, 1080, 0, 0)
_Time("Time", Float) = 0 _CustomTime("Time", Float) = 0
_Position("Position" , Range(0, 1)) = 0.1 _Position("Position" , Range(0, 1)) = 0.1
_Opacity("Opacity" , Range(0, 1)) = 1.0 _Opacity("Opacity" , Range(0, 1)) = 1.0
} }
@ -35,6 +35,7 @@ Shader "Unlit/Ink"
float _ShadeContrast; float _ShadeContrast;
float4 _Resolution; float4 _Resolution;
float _Opacity; float _Opacity;
float _CustomTime;
struct appdata struct appdata
{ {
@ -124,7 +125,10 @@ Shader "Unlit/Ink"
float mappedFloat = lerp(-4.0, 1.5, _Position); float mappedFloat = lerp(-4.0, 1.5, _Position);
uv.x = uv.x * 3.5 + mappedFloat; 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 blot = fbm(p * 2.0 + 4.0) - 0.1;
float shade = fbm(p * 3.0 + 16.0) - 0.2; float shade = fbm(p * 3.0 + 16.0) - 0.2;