< 행운 미니 게임 개선 사항 > 1. 실제 컵에 보여질 재화는 컵 상단에 보이는 수준까지만 노출되도록 적절한 수량이 보여지도록 수정되어야하며, 일정 수량을 넘어가면 그리지 않아야 할 것 같습니다. (※예를들어 최대 20개까지만 보이게 처리한다. 등) 2. 컵에서 재화를 떨굴 때 터치 중일 때는 컵을 기우리고, 터치를 하지 않을 땐 컵을 세우도록 수정 바랍니다. 3. 게임에 진입한 후 몇 초 가량은 아무 조작도 안되는데 게임 시작 후 바로 조작되도록 조작성 개선이 필요할 것 같습니다. 4. 컵에 남은 코인 수량을 표기하도록 개선이 필요할 것 같습니다. 5. 남은 시간이 존재하더라도 컵에 남은 코인이 0개 일 때 화면에 아무런 재화도 남아있지 않다면 즉시 게임이 종료되도록 개선 바랍니다."
This commit is contained in:
parent
ecff6d5e5e
commit
48b65a806b
|
|
@ -11765,6 +11765,7 @@ GameObject:
|
||||||
- component: {fileID: 314847187}
|
- component: {fileID: 314847187}
|
||||||
- component: {fileID: 314847186}
|
- component: {fileID: 314847186}
|
||||||
- component: {fileID: 314847189}
|
- component: {fileID: 314847189}
|
||||||
|
- component: {fileID: 314847190}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: i_girl
|
m_Name: i_girl
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -11850,7 +11851,7 @@ MonoBehaviour:
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 314847184}
|
m_GameObject: {fileID: 314847184}
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
|
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
|
|
@ -11888,6 +11889,55 @@ MonoBehaviour:
|
||||||
m_StringArgument:
|
m_StringArgument:
|
||||||
m_BoolArgument: 0
|
m_BoolArgument: 0
|
||||||
m_CallState: 2
|
m_CallState: 2
|
||||||
|
- eventID: 2
|
||||||
|
callback:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
--- !u!114 &314847190
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 314847184}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Delegates:
|
||||||
|
- eventID: 2
|
||||||
|
callback:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1257193657}
|
||||||
|
m_TargetAssemblyTypeName: Game_Lucky, Assembly-CSharp
|
||||||
|
m_MethodName: OnPointerDown
|
||||||
|
m_Mode: 1
|
||||||
|
m_Arguments:
|
||||||
|
m_ObjectArgument: {fileID: 0}
|
||||||
|
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||||
|
m_IntArgument: 0
|
||||||
|
m_FloatArgument: 0
|
||||||
|
m_StringArgument:
|
||||||
|
m_BoolArgument: 0
|
||||||
|
m_CallState: 2
|
||||||
|
- eventID: 3
|
||||||
|
callback:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls:
|
||||||
|
- m_Target: {fileID: 1257193657}
|
||||||
|
m_TargetAssemblyTypeName: Game_Lucky, Assembly-CSharp
|
||||||
|
m_MethodName: OnPointerUp
|
||||||
|
m_Mode: 1
|
||||||
|
m_Arguments:
|
||||||
|
m_ObjectArgument: {fileID: 0}
|
||||||
|
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||||
|
m_IntArgument: 0
|
||||||
|
m_FloatArgument: 0
|
||||||
|
m_StringArgument:
|
||||||
|
m_BoolArgument: 0
|
||||||
|
m_CallState: 2
|
||||||
--- !u!1001 &315367298
|
--- !u!1001 &315367298
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -42430,6 +42480,41 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1185205402}
|
m_GameObject: {fileID: 1185205402}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!1 &1190514303
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1190514304}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: FallObjs
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &1190514304
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1190514303}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1257193656}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!1 &1191006679
|
--- !u!1 &1191006679
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -45055,6 +45140,7 @@ RectTransform:
|
||||||
- {fileID: 1999037950}
|
- {fileID: 1999037950}
|
||||||
- {fileID: 48983097}
|
- {fileID: 48983097}
|
||||||
- {fileID: 1757808306}
|
- {fileID: 1757808306}
|
||||||
|
- {fileID: 1190514304}
|
||||||
- {fileID: 2127274534}
|
- {fileID: 2127274534}
|
||||||
- {fileID: 1950932324}
|
- {fileID: 1950932324}
|
||||||
- {fileID: 1534428862}
|
- {fileID: 1534428862}
|
||||||
|
|
@ -45097,6 +45183,7 @@ MonoBehaviour:
|
||||||
go_dropobj: {fileID: 6939998903098416576, guid: 762ff4ec5a22c6b45978c6b031b0e7e5, type: 3}
|
go_dropobj: {fileID: 6939998903098416576, guid: 762ff4ec5a22c6b45978c6b031b0e7e5, type: 3}
|
||||||
tf_cup: {fileID: 995025953}
|
tf_cup: {fileID: 995025953}
|
||||||
tf_cupin: {fileID: 1836599685}
|
tf_cupin: {fileID: 1836599685}
|
||||||
|
tf_fallobjs: {fileID: 1190514304}
|
||||||
list_randomblock:
|
list_randomblock:
|
||||||
- {fileID: 1007280070}
|
- {fileID: 1007280070}
|
||||||
- {fileID: 233736480}
|
- {fileID: 233736480}
|
||||||
|
|
@ -71775,10 +71862,9 @@ GameObject:
|
||||||
- component: {fileID: 1957117012}
|
- component: {fileID: 1957117012}
|
||||||
- component: {fileID: 1957117011}
|
- component: {fileID: 1957117011}
|
||||||
- component: {fileID: 1957117010}
|
- component: {fileID: 1957117010}
|
||||||
- component: {fileID: 1957117009}
|
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: trigger
|
m_Name: trigger
|
||||||
m_TagString: Untagged
|
m_TagString: LuckyGameCupTrigger
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
|
|
@ -71802,33 +71888,6 @@ RectTransform:
|
||||||
m_AnchoredPosition: {x: 0, y: -67.1}
|
m_AnchoredPosition: {x: 0, y: -67.1}
|
||||||
m_SizeDelta: {x: 25, y: 145}
|
m_SizeDelta: {x: 25, y: 145}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!50 &1957117009
|
|
||||||
Rigidbody2D:
|
|
||||||
serializedVersion: 5
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1957117007}
|
|
||||||
m_BodyType: 2
|
|
||||||
m_Simulated: 1
|
|
||||||
m_UseFullKinematicContacts: 0
|
|
||||||
m_UseAutoMass: 0
|
|
||||||
m_Mass: 1
|
|
||||||
m_LinearDamping: 0
|
|
||||||
m_AngularDamping: 0.05
|
|
||||||
m_GravityScale: 1
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IncludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_ExcludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_Interpolate: 0
|
|
||||||
m_SleepingMode: 1
|
|
||||||
m_CollisionDetection: 0
|
|
||||||
m_Constraints: 0
|
|
||||||
--- !u!61 &1957117010
|
--- !u!61 &1957117010
|
||||||
BoxCollider2D:
|
BoxCollider2D:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,15 @@ public class Game_Lucky : MonoBehaviour
|
||||||
public GameObject go_dropobj; // 떨어질 공 prefab
|
public GameObject go_dropobj; // 떨어질 공 prefab
|
||||||
public Transform tf_cup; // 컵 (움직이고 회전하는 부분)
|
public Transform tf_cup; // 컵 (움직이고 회전하는 부분)
|
||||||
public Transform tf_cupin; // 컵 안 (공들이 들어가는 위치 부모)
|
public Transform tf_cupin; // 컵 안 (공들이 들어가는 위치 부모)
|
||||||
|
public Transform tf_fallobjs; // 컵 안에서 밖으로 떨어지는 공들의 부모
|
||||||
|
|
||||||
List<GameObject> list_dropobj = new List<GameObject>();
|
List<GameObject> list_dropobj = new List<GameObject>();
|
||||||
public List<LuckyRandomBlock> list_randomblock;
|
public List<LuckyRandomBlock> list_randomblock;
|
||||||
|
|
||||||
// 회전 관련 변수
|
// 회전 관련 변수
|
||||||
private bool isRotating = false;
|
private bool isRotating = false;
|
||||||
private float targetZ = 0f;
|
private float targetZ = -150f;
|
||||||
|
private float originalZ = 0f;
|
||||||
private float rotateSpeed = 150f; // 초당 몇 도 회전할지
|
private float rotateSpeed = 150f; // 초당 몇 도 회전할지
|
||||||
float Cup_minX, Cup_maxX;
|
float Cup_minX, Cup_maxX;
|
||||||
[SerializeField] private float cupMargin = 128.5f; // 간격
|
[SerializeField] private float cupMargin = 128.5f; // 간격
|
||||||
|
|
@ -82,6 +84,7 @@ public class Game_Lucky : MonoBehaviour
|
||||||
// tf_cup 초기화
|
// tf_cup 초기화
|
||||||
tf_cup.localPosition = Vector3.zero;
|
tf_cup.localPosition = Vector3.zero;
|
||||||
tf_cup.rotation = Quaternion.Euler(0, 0, 0);
|
tf_cup.rotation = Quaternion.Euler(0, 0, 0);
|
||||||
|
originalZ = tf_cup.eulerAngles.z;
|
||||||
|
|
||||||
// list_dropobj.Count 가 0 이면 50개 생성해서 tf_cupin 안에 넣기
|
// list_dropobj.Count 가 0 이면 50개 생성해서 tf_cupin 안에 넣기
|
||||||
if (list_dropobj.Count == 0)
|
if (list_dropobj.Count == 0)
|
||||||
|
|
@ -106,7 +109,7 @@ public class Game_Lucky : MonoBehaviour
|
||||||
{
|
{
|
||||||
CupInAmount = TotalBubbleAmount;
|
CupInAmount = TotalBubbleAmount;
|
||||||
texts[2].text = CupInAmount.ToString();
|
texts[2].text = CupInAmount.ToString();
|
||||||
list_dropobj.ForEach(f => f.GetComponent<LuckyGameObj>().Init(Get_CupInLocalPos())); // 컵 안에서 시작
|
list_dropobj.ForEach(f => f.GetComponent<LuckyGameObj>().Init(Get_CupInLocalPos(), tf_cupin, tf_fallobjs)); // 컵 안에서 시작
|
||||||
//list_dropobj.ForEach(f => f.GetComponent<Rigidbody2D>().gravityScale = Random.Range(0.01f, 0.3f));
|
//list_dropobj.ForEach(f => f.GetComponent<Rigidbody2D>().gravityScale = Random.Range(0.01f, 0.3f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,24 +204,31 @@ public class Game_Lucky : MonoBehaviour
|
||||||
SoundInfo.Ins.Play_OneShot((eSound)Random.Range(14, 16));
|
SoundInfo.Ins.Play_OneShot((eSound)Random.Range(14, 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnPointerDown()
|
||||||
|
{
|
||||||
|
isRotating = true;
|
||||||
|
}
|
||||||
|
public void OnPointerUp()
|
||||||
|
{
|
||||||
|
isRotating = false;
|
||||||
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
|
float currentZ = tf_cup.eulerAngles.z;
|
||||||
|
if (currentZ > 180f) currentZ -= 360f; // -180~180 범위 보정
|
||||||
|
|
||||||
if (isRotating)
|
if (isRotating)
|
||||||
{
|
{
|
||||||
// 현재 z 회전값
|
// 목표 각도로 이동
|
||||||
float currentZ = tf_cup.eulerAngles.z;
|
|
||||||
if (currentZ > 180f) currentZ -= 360f; // -180~180 범위로 맞추기
|
|
||||||
|
|
||||||
// 목표 각도로 부드럽게 이동
|
|
||||||
float newZ = Mathf.MoveTowards(currentZ, targetZ, rotateSpeed * Time.deltaTime);
|
float newZ = Mathf.MoveTowards(currentZ, targetZ, rotateSpeed * Time.deltaTime);
|
||||||
tf_cup.rotation = Quaternion.Euler(0, 0, newZ);
|
tf_cup.rotation = Quaternion.Euler(0, 0, newZ);
|
||||||
|
}
|
||||||
// 목표 각도 도달했으면 정지
|
else
|
||||||
if (Mathf.Approximately(newZ, targetZ))
|
{
|
||||||
{
|
// 손을 뗐을 때 원래 각도로 복귀
|
||||||
isRotating = false;
|
float newZ = Mathf.MoveTowards(currentZ, originalZ, rotateSpeed * Time.deltaTime);
|
||||||
list_dropobj.ForEach(f => f.GetComponent<LuckyGameObj>().Tilt_Cup());
|
tf_cup.rotation = Quaternion.Euler(0, 0, newZ);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateTime && m_Time > 0f)
|
if (updateTime && m_Time > 0f)
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,15 @@ public class LuckyGameObj : MonoBehaviour
|
||||||
public Rigidbody2D m_Rigidbody2D;
|
public Rigidbody2D m_Rigidbody2D;
|
||||||
|
|
||||||
ProtectedInt32 m_Amount;
|
ProtectedInt32 m_Amount;
|
||||||
bool isTiltCup, isCollision;
|
bool isInCup, isCollision;
|
||||||
public float velocityThreshold = 0.1f; // 이 값 이하이면 "거의 없음"으로 판단
|
public float velocityThreshold = 0.1f; // 이 값 이하이면 "거의 없음"으로 판단
|
||||||
float stoppedTime = 0f;
|
float stoppedTime = 0f;
|
||||||
public float requiredStopDuration = 0.2f; // 0.2초 이상 멈춰야 인정
|
public float requiredStopDuration = 0.2f; // 0.2초 이상 멈춰야 인정
|
||||||
|
Transform tf_fallobjs;
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
if (isTiltCup && !isCollision && IsAlmostStopped())
|
if (!isInCup && !isCollision && IsAlmostStopped())
|
||||||
{
|
{
|
||||||
//Debug.Log("움직임이 거의 없음");
|
//Debug.Log("움직임이 거의 없음");
|
||||||
Set_Collision(0);
|
Set_Collision(0);
|
||||||
|
|
@ -38,12 +39,14 @@ public class LuckyGameObj : MonoBehaviour
|
||||||
return stoppedTime >= requiredStopDuration;
|
return stoppedTime >= requiredStopDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init(Vector3 pos)
|
public void Init(Vector3 pos, Transform tfcupin, Transform tffallobjs)
|
||||||
{
|
{
|
||||||
|
transform.parent = tfcupin;
|
||||||
transform.localPosition = pos;
|
transform.localPosition = pos;
|
||||||
|
tf_fallobjs = tffallobjs;
|
||||||
|
|
||||||
isTiltCup = isCollision = false;
|
isCollision = false;
|
||||||
m_image.enabled = true;
|
isInCup = m_image.enabled = true;
|
||||||
go_effect.SetActive(false);
|
go_effect.SetActive(false);
|
||||||
m_Amount = 1; m_Amount.Obfuscate();
|
m_Amount = 1; m_Amount.Obfuscate();
|
||||||
m_Rigidbody2D.bodyType = RigidbodyType2D.Dynamic;
|
m_Rigidbody2D.bodyType = RigidbodyType2D.Dynamic;
|
||||||
|
|
@ -54,14 +57,14 @@ public class LuckyGameObj : MonoBehaviour
|
||||||
m_Rigidbody2D.bodyType = RigidbodyType2D.Kinematic;
|
m_Rigidbody2D.bodyType = RigidbodyType2D.Kinematic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tilt_Cup()
|
public void Set_NoInCup()
|
||||||
{
|
{
|
||||||
isTiltCup = true;
|
isInCup = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCollisionEnter2D(Collision2D collision)
|
private void OnCollisionEnter2D(Collision2D collision)
|
||||||
{
|
{
|
||||||
if (!isTiltCup || isCollision || collision == null) return;
|
if (isInCup || isCollision || collision == null) return;
|
||||||
|
|
||||||
//Debug.Log(collision.collider.tag + " : " + collision.collider.name);
|
//Debug.Log(collision.collider.tag + " : " + collision.collider.name);
|
||||||
switch (collision.collider.tag)
|
switch (collision.collider.tag)
|
||||||
|
|
@ -84,6 +87,18 @@ public class LuckyGameObj : MonoBehaviour
|
||||||
m_Amount = lrb.Get_Value(m_Amount);
|
m_Amount = lrb.Get_Value(m_Amount);
|
||||||
m_Amount.Obfuscate();
|
m_Amount.Obfuscate();
|
||||||
break;
|
break;
|
||||||
|
case "LuckyGameCupTrigger":
|
||||||
|
isInCup = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnTriggerExit2D(Collider2D other)
|
||||||
|
{
|
||||||
|
if (other.CompareTag("LuckyGameCupTrigger"))
|
||||||
|
{
|
||||||
|
isInCup = false;
|
||||||
|
transform.parent = tf_fallobjs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue