Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
tetra-tower
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Oenos
tetra-tower
Commits
2a3d3363
Commit
2a3d3363
authored
Feb 25, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 player 및 clock과 같이 많이 참조하는 오브젝트들은 GameManager에서 호출하면됨. 상점 완성함.
parent
5b9ffe20
Changes
35
Show whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
237 additions
and
92 deletions
+237
-92
Player.prefab
Assets/Prefabs/Characters/Player.prefab
+3
-1
GameManager.prefab
Assets/Prefabs/GameManager.prefab
+8
-2
Room Gold.prefab
Assets/Prefabs/Rooms/SpecialRoom/Room Gold.prefab
+6
-6
Room Tutorial.prefab
Assets/Prefabs/TetrisMap/Tetrimino/Room Tutorial.prefab
+29
-5
DisplayText.prefab
Assets/Prefabs/UI/DisplayText.prefab
+88
-0
DisplayText.prefab.meta
Assets/Prefabs/UI/DisplayText.prefab.meta
+8
-0
GameOverScreen.prefab
Assets/Prefabs/UI/GameOverScreen.prefab
+2
-1
InventoryManager.prefab
...Prefabs/UI/In-Game UI/InventoryUI/InventoryManager.prefab
+1
-2
TextCanvas.prefab
Assets/Prefabs/UI/TextCanvas.prefab
+1
-1
TextCanvas.prefab.meta
Assets/Prefabs/UI/TextCanvas.prefab.meta
+0
-0
CameraController.cs
Assets/Scripts/CameraController.cs
+2
-3
Player.cs
Assets/Scripts/Characters/Player.cs
+19
-3
EnemyManager.cs
Assets/Scripts/EnemyManager.cs
+4
-1
GameManager.cs
Assets/Scripts/GameManager.cs
+22
-10
AddonDrag.cs
Assets/Scripts/Item/AddonDrag.cs
+1
-1
FeatherofRheA.cs
Assets/Scripts/Item/Addons/FeatherofRheA.cs
+1
-1
Sandbag.cs
Assets/Scripts/Item/Addons/Sandbag.cs
+1
-1
SmallLens.cs
Assets/Scripts/Item/Addons/SmallLens.cs
+1
-1
DroppedItem.cs
Assets/Scripts/Item/DroppedItem.cs
+1
-4
IPlayerInteraction.cs
Assets/Scripts/Item/IPlayerInteraction.cs
+1
-2
InventoryManager.cs
Assets/Scripts/Item/InventoryManager.cs
+6
-13
InventoryUI.cs
Assets/Scripts/Item/InventoryUI.cs
+5
-1
ItemDrag.cs
Assets/Scripts/Item/ItemDrag.cs
+1
-1
Bow.cs
Assets/Scripts/Item/Items/Bow.cs
+1
-1
SkillPlay.cs
Assets/Scripts/SkillPlay.cs
+1
-1
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+8
-12
Portal.cs
Assets/Scripts/TetrisMap/Portal.cs
+1
-1
Room.cs
Assets/Scripts/TetrisMap/Room.cs
+3
-3
Test.cs
Assets/Scripts/TetrisMap/Test.cs
+1
-1
TetriminoSpawner.cs
Assets/Scripts/TetrisMap/TetriminoSpawner.cs
+2
-2
DroppedLifeStone.cs
...Scripts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs
+1
-4
DroppedObject.cs
...ts/Scripts/UI/In-game UI/LifeStoneScript/DroppedObject.cs
+0
-1
DroppedPotion.cs
...ts/Scripts/UI/In-game UI/LifeStoneScript/DroppedPotion.cs
+2
-0
LifeStoneManager.cs
...Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
+4
-4
LifeStoneTest.cs
...ts/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
+2
-2
No files found.
Assets/Prefabs/Characters/Player.prefab
View file @
2a3d3363
...
...
@@ -431,6 +431,8 @@ MonoBehaviour:
m_EditorClassIdentifier
:
ttx
:
8
tty
:
0
displayText
:
{
fileID
:
114495744039531298
,
guid
:
457100d9937aef244b98ef4f67a0f218
,
type
:
2
}
---
!u!212
&212187280661781960
SpriteRenderer
:
m_ObjectHideFlags
:
1
...
...
@@ -464,7 +466,7 @@ SpriteRenderer:
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
-2078941185
m_SortingLayer
:
9
m_SortingLayer
:
7
m_SortingOrder
:
0
m_Sprite
:
{
fileID
:
21300000
,
guid
:
92d166e0c2a85a14facee45f5a5a8444
,
type
:
3
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
...
...
Assets/Prefabs/GameManager.prefab
View file @
2a3d3363
...
...
@@ -51,5 +51,11 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
97912f0a2214a8a4f8023ed30629bb30
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
gameOverCanvas
:
{
fileID
:
0
}
inventoryCanvas
:
{
fileID
:
0
}
isTutorial
:
0
minimap
:
{
fileID
:
0
}
gameOverCanvas
:
{
fileID
:
223237664237935382
,
guid
:
692aad2449e06054799ea4706578fb23
,
type
:
2
}
inventoryCanvas
:
{
fileID
:
223008133952041092
,
guid
:
7c6db9a9ca4150a438bd5114c58a37cf
,
type
:
2
}
textCanvas
:
{
fileID
:
223566371550133596
,
guid
:
51286afce3c9c8a4bae74feddf8b13af
,
type
:
2
}
Assets/Prefabs/Rooms/SpecialRoom/Room Gold.prefab
View file @
2a3d3363
...
...
@@ -268,7 +268,7 @@ Transform:
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1176163474605492
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
1
5
,
y
:
7
,
z
:
0
}
m_LocalPosition
:
{
x
:
1
3
,
y
:
7
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
4122111573804852
}
...
...
@@ -300,7 +300,7 @@ Transform:
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1501914550378012
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
11
,
y
:
7
,
z
:
0
}
m_LocalPosition
:
{
x
:
9
,
y
:
7
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
4122111573804852
}
...
...
@@ -313,7 +313,7 @@ Transform:
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1365357607970180
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
1
7
,
y
:
7
,
z
:
0
}
m_LocalPosition
:
{
x
:
1
5
,
y
:
7
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
4122111573804852
}
...
...
@@ -326,7 +326,7 @@ Transform:
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1566149986937306
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
1
3
,
y
:
7
,
z
:
0
}
m_LocalPosition
:
{
x
:
1
1
,
y
:
7
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
4122111573804852
}
...
...
@@ -352,7 +352,7 @@ Transform:
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1195436639309608
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
7
,
y
:
7
,
z
:
0
}
m_LocalPosition
:
{
x
:
5
,
y
:
7
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
4122111573804852
}
...
...
@@ -391,7 +391,7 @@ Transform:
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1144240717194000
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
9
,
y
:
7
,
z
:
0
}
m_LocalPosition
:
{
x
:
7
,
y
:
7
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
4122111573804852
}
...
...
Assets/Prefabs/TetrisMap/Tetrimino/Room Tutorial.prefab
View file @
2a3d3363
...
...
@@ -42,7 +42,7 @@ GameObject:
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
0
m_IsActive
:
1
---
!u!1
&1462807162955286
GameObject
:
m_ObjectHideFlags
:
1
...
...
@@ -420,7 +420,25 @@ CompositeCollider2D:
m_GeometryType
:
0
m_GenerationType
:
0
m_EdgeRadius
:
0
m_ColliderPaths
:
[]
m_ColliderPaths
:
-
m_Collider
:
{
fileID
:
2113883504865271124
}
m_ColliderPaths
:
-
-
X
:
480000000
Y
:
100000000
-
X
:
0
Y
:
100000000
-
X
:
0
Y
:
0
-
X
:
480000000
Y
:
0
-
-
X
:
10000000
Y
:
10000000
-
X
:
10000000
Y
:
90000000
-
X
:
470000000
Y
:
90000000
-
X
:
470000000
Y
:
10000000
m_CompositePaths
:
m_Paths
:
-
-
{
x
:
48
,
y
:
10
}
...
...
@@ -448,6 +466,8 @@ CompositeCollider2D:
m_GeometryType
:
0
m_GenerationType
:
0
m_EdgeRadius
:
0
m_ColliderPaths
:
-
m_Collider
:
{
fileID
:
2113883505577540150
}
m_ColliderPaths
:
[]
m_CompositePaths
:
m_Paths
:
[]
...
...
@@ -468,6 +488,8 @@ CompositeCollider2D:
m_GeometryType
:
0
m_GenerationType
:
0
m_EdgeRadius
:
0
m_ColliderPaths
:
-
m_Collider
:
{
fileID
:
2113883505987626316
}
m_ColliderPaths
:
[]
m_CompositePaths
:
m_Paths
:
[]
...
...
@@ -488,6 +510,8 @@ CompositeCollider2D:
m_GeometryType
:
0
m_GenerationType
:
0
m_EdgeRadius
:
0
m_ColliderPaths
:
-
m_Collider
:
{
fileID
:
2113883505389363492
}
m_ColliderPaths
:
[]
m_CompositePaths
:
m_Paths
:
[]
...
...
Assets/Prefabs/UI/DisplayText.prefab
0 → 100644
View file @
2a3d3363
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1001
&100100000
Prefab
:
m_ObjectHideFlags
:
1
serializedVersion
:
2
m_Modification
:
m_TransformParent
:
{
fileID
:
0
}
m_Modifications
:
[]
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
0
}
m_RootGameObject
:
{
fileID
:
1590798276927748
}
m_IsPrefabAsset
:
1
---
!u!1
&1590798276927748
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
224163648038064106
}
-
component
:
{
fileID
:
222537658428060042
}
-
component
:
{
fileID
:
114495744039531298
}
m_Layer
:
0
m_Name
:
DisplayText
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!114
&114495744039531298
MonoBehaviour
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1590798276927748
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
708705254
,
guid
:
f70555f144d8491a825f0804e09c671c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
m_Material
:
{
fileID
:
0
}
m_Color
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
m_RaycastTarget
:
1
m_OnCullStateChanged
:
m_PersistentCalls
:
m_Calls
:
[]
m_TypeName
:
UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData
:
m_Font
:
{
fileID
:
10102
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
m_FontSize
:
1
m_FontStyle
:
0
m_BestFit
:
0
m_MinSize
:
0
m_MaxSize
:
100
m_Alignment
:
4
m_AlignByGeometry
:
0
m_RichText
:
1
m_HorizontalOverflow
:
0
m_VerticalOverflow
:
0
m_LineSpacing
:
1
m_Text
:
---
!u!222
&222537658428060042
CanvasRenderer
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1590798276927748
}
m_CullTransparentMesh
:
0
---
!u!224
&224163648038064106
RectTransform
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1590798276927748
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
0.5
,
y
:
0.5
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
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
:
-924
,
y
:
-528
}
m_SizeDelta
:
{
x
:
100
,
y
:
100
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
Assets/Prefabs/UI/DisplayText.prefab.meta
0 → 100644
View file @
2a3d3363
fileFormatVersion: 2
guid: 457100d9937aef244b98ef4f67a0f218
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
Assets/Prefabs/UI/GameOverScreen.prefab
View file @
2a3d3363
...
...
@@ -218,7 +218,8 @@ MonoBehaviour:
m_OnClick
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
0
}
-
m_Target
:
{
fileID
:
114561382838090706
,
guid
:
f6ef1c586e7764c41ba8349325635589
,
type
:
2
}
m_MethodName
:
RestartGame
m_Mode
:
1
m_Arguments
:
...
...
Assets/Prefabs/UI/In-Game UI/InventoryUI/InventoryManager.prefab
View file @
2a3d3363
...
...
@@ -55,6 +55,5 @@ MonoBehaviour:
type
:
2
}
popoutStrengthMultiplier
:
9
popoutTime
:
0.1
priceCanvas
:
{
fileID
:
1326064071694500
,
guid
:
51286afce3c9c8a4bae74feddf8b13af
,
type
:
2
}
textCanvas
:
{
fileID
:
1326064071694500
,
guid
:
51286afce3c9c8a4bae74feddf8b13af
,
type
:
2
}
price
:
{
fileID
:
114275555228777956
,
guid
:
4ec53eab8ea50de4ea5b9ff658d83ca0
,
type
:
2
}
Assets/Prefabs/UI/
Price
Canvas.prefab
→
Assets/Prefabs/UI/
Text
Canvas.prefab
View file @
2a3d3363
...
...
@@ -23,7 +23,7 @@ GameObject:
-
component
:
{
fileID
:
114428697731747914
}
-
component
:
{
fileID
:
114817208632956030
}
m_Layer
:
5
m_Name
:
Price
Canvas
m_Name
:
Text
Canvas
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
...
...
Assets/Prefabs/UI/
Price
Canvas.prefab.meta
→
Assets/Prefabs/UI/
Text
Canvas.prefab.meta
View file @
2a3d3363
File moved
Assets/Scripts/CameraController.cs
View file @
2a3d3363
...
...
@@ -20,13 +20,12 @@ public class CameraController : MonoBehaviour {
private
void
Awake
()
{
player
=
GameObject
.
Find
(
"Player"
);
}
// Use this for initialization
void
Start
()
{
player
=
GameManager
.
Instance
.
player
;
}
// Update is called once per frame
...
...
@@ -69,7 +68,7 @@ public class CameraController : MonoBehaviour {
{
if
(
isSceneChanging
!=
true
)
{
GameObject
grid
=
GameObject
.
Find
(
"Grid"
)
;
GameObject
grid
=
MapManager
.
Instance
.
grid
.
gameObject
;
float
sizeDestination
=
0
;
isSceneChanging
=
true
;
if
(
gameState
==
GameState
.
Ingame
)
...
...
Assets/Scripts/Characters/Player.cs
View file @
2a3d3363
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
Player
:
MonoBehaviour
{
LifeStoneManager
lifeStoneManager
;
...
...
@@ -8,9 +9,24 @@ public class Player : MonoBehaviour {
public
static
float
X
=
0.7f
,
Y
=
1.6f
;
public
int
ttx
;
public
int
tty
;
public
Text
displayText
;
public
IEnumerator
DisplayText
(
string
_text
)
{
displayText
.
text
=
_text
;
for
(
int
i
=
255
;
i
>=
0
;
i
-=
10
)
{
yield
return
null
;
displayText
.
transform
.
position
=
transform
.
position
+
new
Vector3
(
0
,
2
,
0
);
Debug
.
Log
(
i
);
displayText
.
color
=
new
Color
(
displayText
.
color
.
r
,
displayText
.
color
.
g
,
displayText
.
color
.
b
,
(
float
)
i
/
255
);
}
displayText
.
text
=
""
;
}
// Use this for initialization
void
Start
()
{
displayText
=
Instantiate
(
displayText
,
GameManager
.
Instance
.
textCanvas
.
transform
);
ttx
=
(
int
)(
transform
.
position
.
x
/
24f
);
tty
=
(
int
)(
transform
.
position
.
y
-
0.9f
/
24f
);
lifeStoneManager
=
LifeStoneManager
.
Instance
;
...
...
Assets/Scripts/EnemyManager.cs
View file @
2a3d3363
...
...
@@ -41,10 +41,13 @@ public class EnemyManager : Singleton<EnemyManager>
// Awake
private
void
Awake
()
{
Player
=
GameObject
.
Find
(
"Player"
);
LoadDropTable
(
dropTableData
);
CreateEnemyPool
();
}
private
void
Start
()
{
Player
=
GameManager
.
Instance
.
player
;
}
// Spawn Enemy to Map
public
void
SpawnEnemyToMap
()
...
...
Assets/Scripts/GameManager.cs
View file @
2a3d3363
...
...
@@ -17,9 +17,12 @@ public class GameManager : Singleton<GameManager> {
/// </summary>
Vector3
spawnPosition
=
new
Vector3
(
2
,
1
,
0
);
public
GameObject
player
;
public
GameObject
minimap
;
public
Canvas
gameOverCanvas
;
public
Canvas
inventoryCanvas
;
public
Canvas
textCanvas
;
public
Timer
clock
;
// method
// Constructor - protect calling raw constructor
...
...
@@ -36,8 +39,8 @@ public class GameManager : Singleton<GameManager> {
Destroy
(
MapManager
.
currentRoom
.
gameObject
);
minimap
.
SetActive
(
true
);
TetriminoSpawner
.
Instance
.
MakeInitialTetrimino
();
GameObject
.
Find
(
"Player"
)
.
transform
.
position
=
MapManager
.
currentRoom
.
roomInGame
.
transform
.
Find
(
"portal spot"
).
position
+
spawnPosition
;
GameObject
.
Find
(
"Main Camera"
).
transform
.
position
=
GameObject
.
Find
(
"Player"
)
.
transform
.
position
+
new
Vector3
(
0
,
0
,
-
1
);
player
.
transform
.
position
=
MapManager
.
currentRoom
.
roomInGame
.
transform
.
Find
(
"portal spot"
).
position
+
spawnPosition
;
Camera
.
main
.
transform
.
position
=
player
.
transform
.
position
+
new
Vector3
(
0
,
0
,
-
1
);
}
/// <summary>
...
...
@@ -50,17 +53,26 @@ public class GameManager : Singleton<GameManager> {
void
Awake
()
{
inventoryCanvas
=
Instantiate
(
inventoryCanvas
);
gameOverCanvas
=
Instantiate
(
gameOverCanvas
);
textCanvas
=
Instantiate
(
textCanvas
);
InventoryManager
.
Instance
.
ui
=
inventoryCanvas
.
GetComponent
<
InventoryUI
>();
inventoryCanvas
.
gameObject
.
SetActive
(
false
);
gameOverCanvas
.
gameObject
.
SetActive
(
false
);
gameState
=
GameState
.
Ingame
;
minimap
=
GameObject
.
Find
(
"Minimap"
);
minimap
.
SetActive
(
false
);
player
=
GameObject
.
Find
(
"Player"
);
MapManager
.
currentRoom
=
GameObject
.
Find
(
"Room Tutorial"
).
GetComponent
<
Room
>();
GameObject
.
Find
(
"Player"
).
transform
.
position
=
MapManager
.
currentRoom
.
roomInGame
.
transform
.
Find
(
"player spot"
).
position
+
spawnPosition
;
GameObject
.
Find
(
"Main Camera"
).
transform
.
position
=
GameObject
.
Find
(
"Player"
).
transform
.
position
+
new
Vector3
(
0
,
0
,
-
1
);
player
.
transform
.
position
=
MapManager
.
currentRoom
.
roomInGame
.
transform
.
Find
(
"player spot"
).
position
+
spawnPosition
;
Camera
.
main
.
transform
.
position
=
player
.
transform
.
position
+
new
Vector3
(
0
,
0
,
-
1
);
clock
=
GameObject
.
Find
(
"Clock"
).
GetComponent
<
Timer
>();
isTutorial
=
true
;
}
// Use this for initialization
void
Start
()
{
void
Start
()
{
}
...
...
@@ -73,11 +85,11 @@ public class GameManager : Singleton<GameManager> {
{
if
(
gameState
==
GameState
.
Ingame
)
{
StartCoroutine
(
GameObject
.
FindGameObjectWithTag
(
"MainCamera"
)
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Tetris
));
StartCoroutine
(
Camera
.
main
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Tetris
));
}
else
if
(
gameState
==
GameState
.
Tetris
)
{
StartCoroutine
(
GameObject
.
FindGameObjectWithTag
(
"MainCamera"
)
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Ingame
));
StartCoroutine
(
Camera
.
main
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Ingame
));
}
}
else
if
(
Input
.
GetKeyDown
(
KeyCode
.
I
))
...
...
@@ -97,11 +109,11 @@ public class GameManager : Singleton<GameManager> {
{
if
(
gameState
==
GameState
.
Portal
&&
MapManager
.
currentRoom
!=
MapManager
.
mapGrid
[(
int
)
MapManager
.
portalDestination
.
x
,
(
int
)
MapManager
.
portalDestination
.
y
])
{
GameObject
.
Find
(
"Player"
)
.
transform
.
position
=
MapManager
.
mapGrid
[(
int
)
MapManager
.
portalDestination
.
x
,
(
int
)
MapManager
.
portalDestination
.
y
].
portal
.
transform
.
position
+
spawnPosition
;
player
.
transform
.
position
=
MapManager
.
mapGrid
[(
int
)
MapManager
.
portalDestination
.
x
,
(
int
)
MapManager
.
portalDestination
.
y
].
portal
.
transform
.
position
+
spawnPosition
;
MapManager
.
Instance
.
ChangeRoom
(
MapManager
.
mapGrid
[(
int
)
MapManager
.
portalDestination
.
x
,
(
int
)
MapManager
.
portalDestination
.
y
]);
MapManager
.
mapGrid
[(
int
)
MapManager
.
portalDestination
.
x
,
(
int
)
MapManager
.
portalDestination
.
y
].
portalSurface
.
GetComponent
<
SpriteRenderer
>().
sprite
=
MapManager
.
Instance
.
portalExist
;
StartCoroutine
(
GameObject
.
FindGameObjectWithTag
(
"MainCamera"
)
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Ingame
));
StartCoroutine
(
Camera
.
main
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Ingame
));
}
}
else
if
(
Input
.
GetButtonDown
(
"Cancel"
))
...
...
@@ -112,7 +124,7 @@ public class GameManager : Singleton<GameManager> {
MapManager
.
Instance
.
portalExist
;
MapManager
.
mapGrid
[(
int
)
MapManager
.
currentRoom
.
mapCoord
.
x
,
(
int
)
MapManager
.
currentRoom
.
mapCoord
.
y
].
portalSurface
.
GetComponent
<
SpriteRenderer
>().
sprite
=
MapManager
.
Instance
.
portalExist
;
StartCoroutine
(
GameObject
.
FindGameObjectWithTag
(
"MainCamera"
)
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Ingame
));
StartCoroutine
(
Camera
.
main
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Ingame
));
}
else
if
(
gameState
==
GameState
.
Inventory
)
{
...
...
Assets/Scripts/Item/AddonDrag.cs
View file @
2a3d3363
...
...
@@ -14,7 +14,7 @@ public class AddonDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDra
void
Start
()
{
pointerOn
=
false
;
ui
=
GameObject
.
Find
(
"InventoryCanvas"
).
GetComponent
<
InventoryUI
>()
;
ui
=
InventoryManager
.
Instance
.
ui
;
manager
=
InventoryManager
.
Instance
;
addonGroup
=
ui
.
gameObject
.
transform
.
Find
(
"AddonGroup"
);
discardBin
=
ui
.
gameObject
.
transform
.
Find
(
"DiscardBin"
);
...
...
Assets/Scripts/Item/Addons/FeatherofRheA.cs
View file @
2a3d3363
...
...
@@ -19,7 +19,7 @@ public class FeatherofRheA : Addon
public
override
float
DamageMultiplier
(
PlayerAttackInfo
attackInfo
,
Enemy
enemyInfo
,
string
combo
)
{
if
(!
Game
Object
.
Find
(
"Player"
)
.
GetComponent
<
PlayerController
>().
IsGrounded
())
if
(!
Game
Manager
.
Instance
.
player
.
GetComponent
<
PlayerController
>().
IsGrounded
())
return
1.75f
;
else
return
1f
;
...
...
Assets/Scripts/Item/Addons/Sandbag.cs
View file @
2a3d3363
...
...
@@ -18,7 +18,7 @@ public class Sandbag : Addon
}
public
override
void
OtherEffect
(
string
combo
)
{
Game
Object
.
Find
(
"Player"
)
.
GetComponent
<
PlayerAttack
>().
comboTime
*=
0.5f
;
Game
Manager
.
Instance
.
player
.
GetComponent
<
PlayerAttack
>().
comboTime
*=
0.5f
;
}
public
override
float
DamageMultiplier
(
PlayerAttackInfo
attackInfo
,
Enemy
enemyInfo
,
string
combo
)
{
...
...
Assets/Scripts/Item/Addons/SmallLens.cs
View file @
2a3d3363
...
...
@@ -19,6 +19,6 @@ public class SmallLens : Addon
public
override
void
OtherEffect
(
string
combo
)
{
Game
Object
.
Find
(
"Player"
)
.
GetComponent
<
PlayerAttack
>().
comboTime
*=
1.75f
;
Game
Manager
.
Instance
.
player
.
GetComponent
<
PlayerAttack
>().
comboTime
*=
1.75f
;
}
}
\ No newline at end of file
Assets/Scripts/Item/DroppedItem.cs
View file @
2a3d3363
...
...
@@ -49,10 +49,7 @@ public class DroppedItem : DroppedObject, IPlayerInteraction
public
void
Apply
()
{
if
(
LifeStoneManager
.
Instance
.
CountType
(
LifeStoneType
.
Gold
)
<
price
)
{
Debug
.
Log
(
"Not enough gold"
);
return
;
}
StartCoroutine
(
GameManager
.
Instance
.
player
.
GetComponent
<
Player
>().
DisplayText
(
"Not enough gold"
));
else
if
(!
itemAddon
&&
inventoryManager
.
PushItem
(
item
))
{
LifeStoneManager
.
Instance
.
ChangeToNormal
(
LifeStoneType
.
Gold
,
price
);
...
...
Assets/Scripts/Item/IPlayerInteraction.cs
View file @
2a3d3363
...
...
@@ -4,7 +4,6 @@ using UnityEngine;
public
interface
IPlayerInteraction
{
void
HighlightSwitch
(
bool
enabled
);
void
Apply
();
}
Assets/Scripts/Item/InventoryManager.cs
View file @
2a3d3363
...
...
@@ -7,29 +7,23 @@ public class InventoryManager : Singleton<InventoryManager> {
public
List
<
Item
>
itemList
=
new
List
<
Item
>();
public
List
<
Addon
>
addonList
=
new
List
<
Addon
>();
InventoryUI
ui
;
public
InventoryUI
ui
;
public
List
<
string
>[]
itemPool
=
new
List
<
string
>[
4
];
public
List
<
string
>[]
addonPool
=
new
List
<
string
>[
4
];
public
GameObject
droppedPrefab
;
public
float
popoutStrengthMultiplier
;
public
float
popoutTime
;
public
GameObject
priceCanvas
;
public
Text
price
;
GameObject
player
;
private
void
Start
()
{
ui
=
GameObject
.
Find
(
"InventoryCanvas"
).
GetComponent
<
InventoryUI
>();
GameObject
.
Find
(
"InventoryCanvas"
).
SetActive
(
false
);
priceCanvas
=
Instantiate
(
priceCanvas
);
player
=
GameObject
.
Find
(
"Player"
);
player
=
GameManager
.
Instance
.
player
;
SetPool
();
/*
ItemInstantiate("Dagger", player.transform.position, 0f);
ItemInstantiate
(
"Dagger"
,
player
.
transform
.
position
,
0f
);
AddonInstantiate
(
"ParchmentPiece"
,
player
.
transform
.
position
,
0f
);
AddonInstantiate
(
"Gluttony"
,
player
.
transform
.
position
,
0f
);
ItemInstantiate("Bow", player.transform.position, 0f);
*/
ItemInstantiate
(
"Bow"
,
player
.
transform
.
position
,
0f
);
StartCoroutine
(
TestCoroutine
());
}
...
...
@@ -184,7 +178,7 @@ public class InventoryManager : Singleton<InventoryManager> {
{
GameObject
tmpItem
=
ItemInstantiate
(
itemPool
[(
int
)
quality
][
0
],
pos
,
popoutStrength
);
tmpItem
.
GetComponent
<
DroppedObject
>().
price
=
_price
;
tmpItem
.
GetComponent
<
DroppedObject
>().
priceTag
=
Instantiate
(
price
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
,
price
Canvas
.
transform
);
tmpItem
.
GetComponent
<
DroppedObject
>().
priceTag
=
Instantiate
(
price
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
,
GameManager
.
Instance
.
text
Canvas
.
transform
);
return
tmpItem
;
}
return
null
;
...
...
@@ -249,7 +243,7 @@ public class InventoryManager : Singleton<InventoryManager> {
{
GameObject
tmpItem
=
AddonInstantiate
(
addonPool
[(
int
)
quality
][
0
],
pos
,
popoutStrength
);
tmpItem
.
GetComponent
<
DroppedObject
>().
price
=
_price
;
tmpItem
.
GetComponent
<
DroppedObject
>().
priceTag
=
Instantiate
(
price
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
,
price
Canvas
.
transform
);
tmpItem
.
GetComponent
<
DroppedObject
>().
priceTag
=
Instantiate
(
price
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
,
GameManager
.
Instance
.
text
Canvas
.
transform
);
return
tmpItem
;
}
return
null
;
...
...
@@ -375,5 +369,4 @@ public class InventoryManager : Singleton<InventoryManager> {
}
ui
.
SetOnPosition
(
itemList
,
addonList
);
}
}
Assets/Scripts/Item/InventoryUI.cs
View file @
2a3d3363
...
...
@@ -42,7 +42,6 @@ public class InventoryUI : MonoBehaviour {
InventoryManager
inventoryManager
;
void
Awake
()
{
inventoryManager
=
InventoryManager
.
Instance
;
items
=
new
GameObject
[
9
];
addons
=
new
GameObject
[
9
];
...
...
@@ -82,6 +81,11 @@ public class InventoryUI : MonoBehaviour {
addonInfo
.
SetActive
(
false
);
}
private
void
Start
()
{
inventoryManager
=
InventoryManager
.
Instance
;
}
public
void
SetAddonInfo
()
{
...
...
Assets/Scripts/Item/ItemDrag.cs
View file @
2a3d3363
...
...
@@ -11,7 +11,7 @@ public class ItemDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
Transform
discardBin
;
void
Start
()
{
ui
=
GameObject
.
Find
(
"InventoryCanvas"
).
GetComponent
<
InventoryUI
>()
;
ui
=
InventoryManager
.
Instance
.
ui
;
manager
=
InventoryManager
.
Instance
;
discardBin
=
ui
.
gameObject
.
transform
.
Find
(
"DiscardBin"
);
}
...
...
Assets/Scripts/Item/Items/Bow.cs
View file @
2a3d3363
...
...
@@ -25,7 +25,7 @@ public class Bow : Item {
itemInfo
=
"단순한 나무활. 군더더기 없는 깔끔한 모습이지만 금방이라도 부셔질 듯이 조잡한 것을 보니 싸구려 인듯 하다."
;
comboName
=
new
string
[
3
]
{
"쏘기"
,
"위로 쏘기"
,
""
};
player
=
Game
Object
.
Find
(
"Player"
)
;
player
=
Game
Manager
.
Instance
.
player
;
arrow
=
Resources
.
Load
<
GameObject
>(
"Prefabs/Projectiles/bow_arrow"
);
}
...
...
Assets/Scripts/SkillPlay.cs
View file @
2a3d3363
...
...
@@ -9,7 +9,7 @@ public class SkillPlay : StateMachineBehaviour {
public
GameObject
player
;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override
public
void
OnStateEnter
(
Animator
animator
,
AnimatorStateInfo
stateInfo
,
int
layerIndex
)
{
player
=
Game
Object
.
Find
(
"Player"
)
;
player
=
Game
Manager
.
Instance
.
player
;
playercontroller
=
player
.
GetComponent
<
PlayerController
>();
playerattack
=
player
.
GetComponent
<
PlayerAttack
>();
}
...
...
Assets/Scripts/TetrisMap/MapManager.cs
View file @
2a3d3363
...
...
@@ -7,7 +7,6 @@ public class MapManager : Singleton<MapManager> {
/*
* variables
* */
public
GameObject
player
;
/// <summary>
/// The clock indicates time of tetrimino.
/// </summary>
...
...
@@ -460,7 +459,7 @@ public class MapManager : Singleton<MapManager> {
}
}
isRoomFalling
=
true
;
Vector3
previousPlayerRelativePosition
=
player
.
transform
.
position
-
currentRoom
.
transform
.
position
;
Vector3
previousPlayerRelativePosition
=
GameManager
.
Instance
.
player
.
transform
.
position
-
currentRoom
.
transform
.
position
;
while
(
tetrisYCoord
[
top
+
1
]
>
bottom
*
tetrisMapSize
)
{
while
(
GameManager
.
gameState
==
GameState
.
Portal
)
...
...
@@ -482,20 +481,19 @@ public class MapManager : Singleton<MapManager> {
}
SetRoomsYCoord
();
if
(
currentRoom
.
mapCoord
.
y
>=
bottom
)
player
.
transform
.
position
+=
new
Vector3
(
0
,
-
yFallSpeed
,
0
);
previousPlayerRelativePosition
=
player
.
transform
.
position
-
currentRoom
.
transform
.
position
;
GameManager
.
Instance
.
player
.
transform
.
position
+=
new
Vector3
(
0
,
-
yFallSpeed
,
0
);
previousPlayerRelativePosition
=
GameManager
.
Instance
.
player
.
transform
.
position
-
currentRoom
.
transform
.
position
;
}
if
(
shakeCamera
)
{
Camera
camera
=
GameObject
.
FindGameObjectWithTag
(
"MainCamera"
).
GetComponent
<
Camera
>();
StartCoroutine
(
camera
.
GetComponent
<
CameraController
>().
CameraShake
(
5
*
(
top
-
bottom
+
1
)
/
CameraController
.
tetrisCameraSize
));
StartCoroutine
(
Camera
.
main
.
GetComponent
<
CameraController
>().
CameraShake
(
5
*
(
top
-
bottom
+
1
)
/
CameraController
.
tetrisCameraSize
));
}
for
(
int
i
=
0
;
i
<
height
;
i
++)
{
tetrisYCoord
[
i
]
=
i
*
tetrisMapSize
;
}
DecreaseRowsAbove
(
top
,
bottom
);
player
.
transform
.
position
=
currentRoom
.
transform
.
position
+
previousPlayerRelativePosition
;
GameManager
.
Instance
.
player
.
transform
.
position
=
currentRoom
.
transform
.
position
+
previousPlayerRelativePosition
;
isRoomFalling
=
false
;
for
(
int
i
=
0
;
i
<
width
;
i
++)
{
...
...
@@ -675,7 +673,7 @@ public class MapManager : Singleton<MapManager> {
fallSpeed
+=
gravity
*
fallTime
*
fallTime
;
te
.
transform
.
position
+=
new
Vector3
(
0
,
-
fallSpeed
,
0
);
}
StartCoroutine
(
GameObject
.
FindGameObjectWithTag
(
"MainCamera"
)
.
GetComponent
<
CameraController
>().
CameraShake
(
20
/
CameraController
.
tetrisCameraSize
));
StartCoroutine
(
Camera
.
main
.
GetComponent
<
CameraController
>().
CameraShake
(
20
/
CameraController
.
tetrisCameraSize
));
EndTetrimino
(
te
);
}
/// <summary>
...
...
@@ -840,7 +838,7 @@ public class MapManager : Singleton<MapManager> {
/// <returns></returns>
public
IEnumerator
MakeNextTetrimino
()
{
StartCoroutine
(
Game
Object
.
Find
(
"Clock"
)
.
GetComponent
<
Timer
>().
ResetClock
());
StartCoroutine
(
Game
Manager
.
Instance
.
clock
.
GetComponent
<
Timer
>().
ResetClock
());
yield
return
new
WaitForSeconds
(
1f
);
TetriminoSpawner
.
Instance
.
MakeTetrimino
();
}
...
...
@@ -1148,14 +1146,12 @@ public class MapManager : Singleton<MapManager> {
for (int i = 0; i < roomBackgroundSprite5.Length; i++)
roomBackgroundSpritesDistributed[4].Add(roomBackgroundSprite5[i]);*/
currentStage
=
0
;
player
=
GameObject
.
Find
(
"Player"
);
clock
=
GameObject
.
Find
(
"Clock"
).
GetComponent
<
Timer
>();
grid
=
GameObject
.
Find
(
"Grid"
).
transform
;
}
// Use this for initialization
void
Start
()
{
clock
=
GameManager
.
Instance
.
clock
;
}
// Update is called once per frame
...
...
Assets/Scripts/TetrisMap/Portal.cs
View file @
2a3d3363
...
...
@@ -14,7 +14,7 @@ public class Portal : MonoBehaviour, IPlayerInteraction {
isPortalUsed
=
true
;
}
else
if
(!
GameManager
.
Instance
.
isTutorial
&&
GameManager
.
gameState
==
GameState
.
Ingame
)
StartCoroutine
(
GameObject
.
FindGameObjectWithTag
(
"MainCamera"
)
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Portal
));
StartCoroutine
(
Camera
.
main
.
GetComponent
<
CameraController
>().
ChangeScene
(
GameState
.
Portal
));
}
public
void
HighlightSwitch
(
bool
enabled
)
...
...
Assets/Scripts/TetrisMap/Room.cs
View file @
2a3d3363
...
...
@@ -393,9 +393,9 @@ public class Room : MonoBehaviour
fog
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
CreatePortal
();
isRoomCleared
=
true
;
Map
Manager
.
Instance
.
clock
.
clockSpeedStack
-=
3
;
if
(
Map
Manager
.
Instance
.
clock
.
clockSpeedStack
<
0
)
Map
Manager
.
Instance
.
clock
.
clockSpeedStack
=
0
;
Game
Manager
.
Instance
.
clock
.
clockSpeedStack
-=
3
;
if
(
Game
Manager
.
Instance
.
clock
.
clockSpeedStack
<
0
)
Game
Manager
.
Instance
.
clock
.
clockSpeedStack
=
0
;
roomInGame
.
RoomClear
();
}
//Need to make extra works.
...
...
Assets/Scripts/TetrisMap/Test.cs
View file @
2a3d3363
...
...
@@ -49,7 +49,7 @@ public class Test : MonoBehaviour {
}
public
void
Timer
()
{
timer
.
text
=
(
MapManager
.
Instance
.
clock
.
timeToFallTetrimino
-
Map
Manager
.
Instance
.
clock
.
tetriminoWaitedTime
).
ToString
();
timer
.
text
=
(
GameManager
.
Instance
.
clock
.
timeToFallTetrimino
-
Game
Manager
.
Instance
.
clock
.
tetriminoWaitedTime
).
ToString
();
}
public
void
ClearRoom
()
{
...
...
Assets/Scripts/TetrisMap/TetriminoSpawner.cs
View file @
2a3d3363
...
...
@@ -70,8 +70,8 @@ public class TetriminoSpawner : Singleton<TetriminoSpawner> {
{
MapManager
.
Instance
.
UpgradeRoom
(
MapManager
.
Instance
.
roomsWaiting
.
Dequeue
());
}
Map
Manager
.
Instance
.
clock
.
tetriminoCreatedTime
=
Time
.
time
;
Timer
.
timer
=
StartCoroutine
(
Game
Object
.
Find
(
"Clock"
).
GetComponent
<
Timer
>()
.
CountTetriminoWaitingTime
());
Game
Manager
.
Instance
.
clock
.
tetriminoCreatedTime
=
Time
.
time
;
Timer
.
timer
=
StartCoroutine
(
Game
Manager
.
Instance
.
clock
.
CountTetriminoWaitingTime
());
}
}
/// <summary>
...
...
Assets/Scripts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs
View file @
2a3d3363
...
...
@@ -53,10 +53,7 @@ public class DroppedLifeStone : DroppedObject, IPlayerInteraction
public
void
Apply
()
{
if
(
LifeStoneManager
.
Instance
.
CountType
(
LifeStoneType
.
Gold
)
<
price
)
{
Debug
.
Log
(
"Not enough gold"
);
return
;
}
StartCoroutine
(
GameManager
.
Instance
.
player
.
GetComponent
<
Player
>().
DisplayText
(
"Not enough gold"
));
else
if
(
LifeStoneManager
.
Instance
.
PushLifeStone
(
info
))
{
LifeStoneManager
.
Instance
.
ChangeToNormal
(
LifeStoneType
.
Gold
,
price
);
...
...
Assets/Scripts/UI/In-game UI/LifeStoneScript/DroppedObject.cs
View file @
2a3d3363
...
...
@@ -7,5 +7,4 @@ public class DroppedObject : MonoBehaviour
{
public
int
price
=
0
;
public
Text
priceTag
;
}
Assets/Scripts/UI/In-game UI/LifeStoneScript/DroppedPotion.cs
View file @
2a3d3363
...
...
@@ -9,6 +9,8 @@ public class DroppedPotion : DroppedObject, IPlayerInteraction{
public
void
Apply
()
{
if
(
LifeStoneManager
.
Instance
.
CountType
(
LifeStoneType
.
Gold
)
<
price
)
StartCoroutine
(
GameManager
.
Instance
.
player
.
GetComponent
<
Player
>().
DisplayText
(
"Not enough gold"
));
LifeStoneManager
.
Instance
.
ChangeFromNormal
(
LifeStoneType
.
Gold
,
3
);
Destroy
(
gameObject
);
}
...
...
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
View file @
2a3d3363
...
...
@@ -98,7 +98,7 @@ public class LifeStoneManager : Singleton<LifeStoneManager> {
GameObject
tmpPotion
=
Instantiate
(
goldPotionPrefab
,
pos
,
Quaternion
.
identity
);
PopoutGenerator
(
tmpPotion
,
popoutStrength
);
tmpPotion
.
GetComponent
<
DroppedObject
>().
price
=
_price
;
tmpPotion
.
GetComponent
<
DroppedObject
>().
priceTag
=
Instantiate
(
InventoryManager
.
Instance
.
price
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
,
InventoryManager
.
Instance
.
price
Canvas
.
transform
);
tmpPotion
.
GetComponent
<
DroppedObject
>().
priceTag
=
Instantiate
(
InventoryManager
.
Instance
.
price
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
,
GameManager
.
Instance
.
text
Canvas
.
transform
);
return
tmpPotion
;
}
...
...
@@ -174,7 +174,7 @@ public class LifeStoneManager : Singleton<LifeStoneManager> {
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
CreateLifeStoneInfo
(
size
,
goldPer
,
ameNum
),
pos
);
PopoutGenerator
(
tmpObj
,
popoutStrength
);
tmpObj
.
GetComponent
<
DroppedObject
>().
price
=
_price
;
tmpObj
.
GetComponent
<
DroppedObject
>().
priceTag
=
Instantiate
(
InventoryManager
.
Instance
.
price
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
,
InventoryManager
.
Instance
.
price
Canvas
.
transform
);
tmpObj
.
GetComponent
<
DroppedObject
>().
priceTag
=
Instantiate
(
InventoryManager
.
Instance
.
price
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
,
GameManager
.
Instance
.
text
Canvas
.
transform
);
return
tmpObj
;
}
...
...
@@ -388,7 +388,7 @@ public class LifeStoneManager : Singleton<LifeStoneManager> {
}
InstantiateDroppedLifeStone
(
CreateLifeStoneInfo
(
new
LifeStoneInfo
(
new
Vector2Int
(
pSize
.
x
,
pSize
.
y
-
cutRow
),
new
string
(
newFill
))),
Game
Object
.
Find
(
"Player"
)
.
transform
.
position
+
new
Vector3
(
droppedLifeStonePrefab
.
GetComponent
<
DroppedLifeStone
>().
unitSprite
.
GetComponent
<
SpriteRenderer
>().
bounds
.
size
.
x
*
i
,
0
,
0
),
Game
Manager
.
Instance
.
player
.
transform
.
position
+
new
Vector3
(
droppedLifeStonePrefab
.
GetComponent
<
DroppedLifeStone
>().
unitSprite
.
GetComponent
<
SpriteRenderer
>().
bounds
.
size
.
x
*
i
,
0
,
0
),
1f
);
}
}
...
...
@@ -461,7 +461,7 @@ public class LifeStoneManager : Singleton<LifeStoneManager> {
IEnumerator
HitRedEffect
(
int
damage
)
{
float
startTime
=
Time
.
time
,
endTime
=
startTime
+
0.3f
;
SpriteRenderer
sprt
=
Game
Object
.
Find
(
"Player"
)
.
GetComponent
<
SpriteRenderer
>();
SpriteRenderer
sprt
=
Game
Manager
.
Instance
.
player
.
GetComponent
<
SpriteRenderer
>();
sprt
.
color
=
new
Color
(
1
,
0
,
0
);
while
(
Time
.
time
<
endTime
)
...
...
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
View file @
2a3d3363
...
...
@@ -18,7 +18,7 @@ public class LifeStoneTest : MonoBehaviour {
public
void
push
()
{
uii
.
InstantiateDroppedLifeStone
(
Convert
.
ToInt32
(
numText
.
GetComponent
<
InputField
>().
text
),
Convert
.
ToSingle
(
goldPerText
.
GetComponent
<
InputField
>().
text
),
Convert
.
ToInt32
(
ameNumText
.
GetComponent
<
InputField
>().
text
),
Game
Object
.
Find
(
"Player"
)
.
transform
.
position
,
1f
);
uii
.
InstantiateDroppedLifeStone
(
Convert
.
ToInt32
(
numText
.
GetComponent
<
InputField
>().
text
),
Convert
.
ToSingle
(
goldPerText
.
GetComponent
<
InputField
>().
text
),
Convert
.
ToInt32
(
ameNumText
.
GetComponent
<
InputField
>().
text
),
Game
Manager
.
Instance
.
player
.
transform
.
position
,
1f
);
}
public
void
gold
()
{
...
...
@@ -42,6 +42,6 @@ public class LifeStoneTest : MonoBehaviour {
}
public
void
goldPotion
()
{
uii
.
InstantiatePotion
(
Game
Object
.
Find
(
"Player"
)
.
transform
.
position
,
1f
);
uii
.
InstantiatePotion
(
Game
Manager
.
Instance
.
player
.
transform
.
position
,
1f
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment