Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Refactor: Mission Class #88

Merged
merged 3 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions 1984/.idea/.idea.1984/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

153 changes: 61 additions & 92 deletions 1984/Assets/Prefabs/UI/Mission/MoneyMission.prefab
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &445139819197513173
--- !u!1 &206822712
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2547497026634468633}
- component: {fileID: 3983062006187425083}
- component: {fileID: 7930244855812752566}
- component: {fileID: 206822713}
- component: {fileID: 206822715}
- component: {fileID: 206822714}
m_Layer: 5
m_Name: TriggerTimeMission
m_Name: Target
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2547497026634468633
--- !u!224 &206822713
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 445139819197513173}
m_GameObject: {fileID: 206822712}
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: 8225653515790860592}
m_RootOrder: 0
m_Father: {fileID: 8225653517439371429}
m_RootOrder: 2
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: 50, y: 71}
m_SizeDelta: {x: 100, y: 100}
m_AnchoredPosition: {x: 706, y: -337.09}
m_SizeDelta: {x: 240.4906, y: 194.5094}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3983062006187425083
--- !u!222 &206822715
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 445139819197513173}
m_GameObject: {fileID: 206822712}
m_CullTransparentMesh: 1
--- !u!114 &7930244855812752566
--- !u!114 &206822714
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 445139819197513173}
m_GameObject: {fileID: 206822712}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
Expand All @@ -66,7 +66,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 83d88a0d7c91bbc4e83c8613a2b5ed63, type: 3}
m_Sprite: {fileID: 21300000, guid: a7dd476ea864a554594c8024fd0e2dd2, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
Expand All @@ -76,62 +76,60 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &8225653515790860593
--- !u!1 &531507853
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8225653515790860592}
- component: {fileID: 8225653515790860589}
- component: {fileID: 8225653515790860590}
- component: {fileID: 3377146159429402022}
- component: {fileID: 4997758520336397727}
- component: {fileID: 531507854}
- component: {fileID: 531507857}
- component: {fileID: 531507856}
- component: {fileID: 531507855}
m_Layer: 5
m_Name: DragMission_1
m_Name: DragMission
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8225653515790860592
--- !u!224 &531507854
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8225653515790860593}
m_GameObject: {fileID: 531507853}
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:
- {fileID: 2547497026634468633}
m_Children: []
m_Father: {fileID: 8225653517439371429}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 163.1825, y: 163.89005}
m_AnchoredPosition: {x: 169, y: 431}
m_SizeDelta: {x: 132.8226, y: 116.4605}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8225653515790860589
--- !u!222 &531507857
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8225653515790860593}
m_GameObject: {fileID: 531507853}
m_CullTransparentMesh: 1
--- !u!114 &8225653515790860590
--- !u!114 &531507856
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8225653515790860593}
m_GameObject: {fileID: 531507853}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
Expand All @@ -155,63 +153,46 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &3377146159429402022
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8225653515790860593}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 79749dbbd846f724b970e5cf60e9977d, type: 3}
m_Name:
m_EditorClassIdentifier:
missionController: {fileID: 8225653517439371428}
target: {fileID: 8225653516432791716}
successValue: 2
successDistance: 20
--- !u!114 &4997758520336397727
--- !u!114 &531507855
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8225653515790860593}
m_GameObject: {fileID: 531507853}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d58b4581556bbe04baa0401d7a149470, type: 3}
m_Name:
m_EditorClassIdentifier:
missionController: {fileID: 8225653517439371428}
target: {fileID: 8225653516432791716}
target: {fileID: 206822713}
successDistance: 20
--- !u!1 &8225653516432791717
--- !u!1 &8225653515790860593
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8225653516432791716}
- component: {fileID: 8225653516432791714}
- component: {fileID: 8225653516432791715}
- component: {fileID: 9177294042956463144}
- component: {fileID: 8225653515790860592}
- component: {fileID: 8225653515790860589}
- component: {fileID: 8225653515790860590}
- component: {fileID: 5420048125335729564}
m_Layer: 5
m_Name: Target
m_Name: ClickMission
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8225653516432791716
--- !u!224 &8225653515790860592
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8225653516432791717}
m_GameObject: {fileID: 8225653515790860593}
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}
Expand All @@ -220,40 +201,40 @@ RectTransform:
m_Father: {fileID: 8225653517439371429}
m_RootOrder: 0
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: 402.28, y: -195.07}
m_SizeDelta: {x: 285.4467, y: 230.8699}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 163.1825, y: 163.89005}
m_SizeDelta: {x: 132.8226, y: 116.4605}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8225653516432791714
--- !u!222 &8225653515790860589
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8225653516432791717}
m_GameObject: {fileID: 8225653515790860593}
m_CullTransparentMesh: 1
--- !u!114 &8225653516432791715
--- !u!114 &8225653515790860590
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8225653516432791717}
m_GameObject: {fileID: 8225653515790860593}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: a7dd476ea864a554594c8024fd0e2dd2, type: 3}
m_Sprite: {fileID: 21300000, guid: 83d88a0d7c91bbc4e83c8613a2b5ed63, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
Expand All @@ -263,32 +244,19 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!61 &9177294042956463144
BoxCollider2D:
--- !u!114 &5420048125335729564
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8225653516432791717}
m_GameObject: {fileID: 8225653515790860593}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
oldSize: {x: 0, y: 0}
newSize: {x: 0, y: 0}
adaptiveTilingThreshold: 0
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35b89c9bf9ba2e54698a1ef78befbcb6, type: 3}
m_Name:
m_EditorClassIdentifier:
successValue: 5
--- !u!1 &8225653517439371433
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -321,8 +289,9 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8225653516432791716}
- {fileID: 8225653515790860592}
- {fileID: 531507854}
- {fileID: 206822713}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down
8 changes: 8 additions & 0 deletions 1984/Assets/Scripts/Runtime/UI/Mission/Function.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions 1984/Assets/Scripts/Runtime/UI/Mission/Function/CountLogic.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;

public class CountLogic
{
public Action OnCountChanged;
public Action OnCountMax;

private float _count;
private readonly float _maxCount;
Comment on lines +8 to +9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

질문 있슴니다.........
변수명 앞에 붙은 _ 이런 표시는 클래스 내에서 전역적으로 쓰일 때 붙여야 하는거야?
전역변수 private 으로 선언될 때 쓰는 규칙인가요...?

Copy link
Contributor Author

@fkdl0048 fkdl0048 Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

카멜표기법이라고 부르는데 간단하게 멤버 private은 _로 구분하고 public, protected는 붙이지 않는 것

정리 잘된 블로그 글이라 이거 보며 조금 이해될거야

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헐 고마워...! 당장 읽어볼게


public CountLogic(float maxCount, float count = 0)
{
_maxCount = maxCount;
_count = count;
}

public void AddCount(int count)
{
_count += count;
OnCountChanged?.Invoke();

if (_count >= _maxCount)
{
OnCountMax?.Invoke();
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading