ㅈ페ㅔ
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
Assets/01_Scenes/blackjack.unity
LFS
BIN
Assets/01_Scenes/blackjack.unity
LFS
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47ef309091683cf409e48c93663f025b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,151 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class GeppettoRunTriggerZone : MonoBehaviour
|
||||
{
|
||||
[Header("Trigger")]
|
||||
public string playerTag = "Player";
|
||||
|
||||
[Header("Geppetto")]
|
||||
public Transform geppetto;
|
||||
public Animator geppettoAnimator;
|
||||
public string runBoolName = "isRunning";
|
||||
|
||||
[Header("Move")]
|
||||
public float runSpeed = 5f;
|
||||
public float rotateSpeed = 8f;
|
||||
public float fadeDistance = 2f;
|
||||
|
||||
[Header("Fade")]
|
||||
public Image blackFadeImage;
|
||||
public float fadeDuration = 1f;
|
||||
|
||||
[Header("Scene")]
|
||||
public string nextSceneName;
|
||||
|
||||
private Transform targetPlayer;
|
||||
private bool started = false;
|
||||
private bool fading = false;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (blackFadeImage != null)
|
||||
{
|
||||
blackFadeImage.gameObject.SetActive(true);
|
||||
|
||||
Color c = blackFadeImage.color;
|
||||
c.a = 0f;
|
||||
blackFadeImage.color = c;
|
||||
}
|
||||
|
||||
if (geppettoAnimator != null && !string.IsNullOrEmpty(runBoolName))
|
||||
{
|
||||
geppettoAnimator.SetBool(runBoolName, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (started)
|
||||
return;
|
||||
|
||||
if (!IsPlayer(other))
|
||||
return;
|
||||
|
||||
Debug.Log("제페토 이벤트 구역 진입: " + other.name);
|
||||
|
||||
targetPlayer = other.transform;
|
||||
started = true;
|
||||
|
||||
if (geppettoAnimator != null && !string.IsNullOrEmpty(runBoolName))
|
||||
{
|
||||
geppettoAnimator.SetBool(runBoolName, true);
|
||||
}
|
||||
|
||||
Collider triggerCollider = GetComponent<Collider>();
|
||||
if (triggerCollider != null)
|
||||
{
|
||||
triggerCollider.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!started || fading)
|
||||
return;
|
||||
|
||||
if (geppetto == null || targetPlayer == null)
|
||||
return;
|
||||
|
||||
Vector3 dir = targetPlayer.position - geppetto.position;
|
||||
dir.y = 0f;
|
||||
|
||||
float distance = dir.magnitude;
|
||||
|
||||
if (dir.sqrMagnitude > 0.001f)
|
||||
{
|
||||
Quaternion targetRotation = Quaternion.LookRotation(dir);
|
||||
geppetto.rotation = Quaternion.Slerp(
|
||||
geppetto.rotation,
|
||||
targetRotation,
|
||||
Time.deltaTime * rotateSpeed
|
||||
);
|
||||
|
||||
geppetto.position += dir.normalized * runSpeed * Time.deltaTime;
|
||||
}
|
||||
|
||||
if (distance <= fadeDistance)
|
||||
{
|
||||
StartCoroutine(FadeOutAndLoadScene());
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator FadeOutAndLoadScene()
|
||||
{
|
||||
fading = true;
|
||||
|
||||
if (geppettoAnimator != null && !string.IsNullOrEmpty(runBoolName))
|
||||
{
|
||||
geppettoAnimator.SetBool(runBoolName, false);
|
||||
}
|
||||
|
||||
float t = 0f;
|
||||
|
||||
while (t < fadeDuration)
|
||||
{
|
||||
t += Time.deltaTime;
|
||||
float alpha = Mathf.Clamp01(t / fadeDuration);
|
||||
|
||||
if (blackFadeImage != null)
|
||||
{
|
||||
Color c = blackFadeImage.color;
|
||||
c.a = alpha;
|
||||
blackFadeImage.color = c;
|
||||
}
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(nextSceneName))
|
||||
{
|
||||
SceneManager.LoadScene(nextSceneName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("Next Scene Name이 비어있습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsPlayer(Collider other)
|
||||
{
|
||||
if (other.CompareTag(playerTag))
|
||||
return true;
|
||||
|
||||
if (other.transform.root.CompareTag(playerTag))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9147beba2b87e4d4b9644fb0647ef6b2
|
||||
@@ -12,9 +12,6 @@ AnimatorStateMachine:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -2406606947297670322}
|
||||
m_Position: {x: -210, y: 20, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -3832682758273198342}
|
||||
m_Position: {x: 100, y: -170, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 6143119609231041675}
|
||||
m_Position: {x: -378.74075, y: -74.29628, z: 0}
|
||||
@@ -43,32 +40,6 @@ AnimatorTransition:
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 1
|
||||
--- !u!1102 &-3832682758273198342
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: KA_Idle33_Hug1_1
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
m_WriteDefaultValues: 1
|
||||
m_Mirror: 0
|
||||
m_SpeedParameterActive: 0
|
||||
m_MirrorParameterActive: 0
|
||||
m_CycleOffsetParameterActive: 0
|
||||
m_TimeParameterActive: 0
|
||||
m_Motion: {fileID: 8993902097722301239, guid: e3140c001bd1dd249b2f4885d3041714, type: 3}
|
||||
m_Tag:
|
||||
m_SpeedParameter:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1102 &-2406606947297670322
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
@@ -103,7 +74,10 @@ AnimatorStateTransition:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: isRunning
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 6143119609231041675}
|
||||
m_Solo: 0
|
||||
@@ -126,7 +100,13 @@ AnimatorController:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: gepto
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorParameters:
|
||||
- m_Name: isRunning
|
||||
m_Type: 4
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
@@ -140,28 +120,6 @@ AnimatorController:
|
||||
m_IKPass: 0
|
||||
m_SyncedLayerAffectsTiming: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
--- !u!1101 &2768032479665430707
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -3832682758273198342}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.77272725
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &6143119609231041675
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
@@ -172,8 +130,7 @@ AnimatorState:
|
||||
m_Name: Running (1)
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: 2768032479665430707}
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
|
||||
BIN
Assets/04_Models/Objects/stone_hut_with_camp_fire.glb
Normal file
BIN
Assets/04_Models/Objects/stone_hut_with_camp_fire.glb
Normal file
Binary file not shown.
28
Assets/04_Models/Objects/stone_hut_with_camp_fire.glb.meta
Normal file
28
Assets/04_Models/Objects/stone_hut_with_camp_fire.glb.meta
Normal file
@@ -0,0 +1,28 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44bc951c8943f4642b0ef9dc7fb25204
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 715df9372183c47e389bb6e19fbc3b52, type: 3}
|
||||
editorImportSettings:
|
||||
generateSecondaryUVSet: 0
|
||||
importSettings:
|
||||
nodeNameMethod: 1
|
||||
animationMethod: 2
|
||||
generateMipMaps: 1
|
||||
texturesReadable: 0
|
||||
defaultMinFilterMode: 9729
|
||||
defaultMagFilterMode: 9729
|
||||
anisotropicFilterLevel: 1
|
||||
instantiationSettings:
|
||||
mask: -1
|
||||
layer: 0
|
||||
skinUpdateWhenOffscreen: 1
|
||||
lightIntensityFactor: 1
|
||||
sceneObjectCreation: 2
|
||||
assetDependencies: []
|
||||
reportItems: []
|
||||
BIN
Assets/New Terrain 1.asset
LFS
Normal file
BIN
Assets/New Terrain 1.asset
LFS
Normal file
Binary file not shown.
8
Assets/New Terrain 1.asset.meta
Normal file
8
Assets/New Terrain 1.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d5fd6eed5b5a9b940b1db858e80950af
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 15600000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -20,3 +20,4 @@ TerrainLayer:
|
||||
m_DiffuseRemapMax: {x: 1, y: 1, z: 1, w: 1}
|
||||
m_MaskMapRemapMin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_MaskMapRemapMax: {x: 1, y: 1, z: 1, w: 1}
|
||||
m_SmoothnessSource: 1
|
||||
|
||||
Reference in New Issue
Block a user