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
650f5e50
Commit
650f5e50
authored
6 years ago
by
18류지석
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LifeStoneManager Singleton으로 개편. 씬에 LifeStoneManager를 넣어야 정상작동하니 머지할때 꼭 넣어야한다.
parent
f2b91f41
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
97 additions
and
47 deletions
+97
-47
LifeStoneManager.prefab
Assets/Prefabs/LifeStoneManager.prefab
+74
-0
LifeStoneManager.prefab.meta
Assets/Prefabs/LifeStoneManager.prefab.meta
+8
-0
LifeStoneUI.prefab
Assets/Prefabs/UI/In-Game UI/LifeStoneUI.prefab
+0
-33
Enemy.cs
Assets/Scripts/Characters/Enemy/Enemy.cs
+1
-1
Player.cs
Assets/Scripts/Characters/Player.cs
+2
-2
PlayerAttack.cs
Assets/Scripts/Characters/PlayerAttack.cs
+2
-1
Gluttony.cs
Assets/Scripts/Item/Addons/Gluttony.cs
+1
-1
JanusCoin.cs
Assets/Scripts/Item/Addons/JanusCoin.cs
+1
-1
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+1
-1
ItemRoomInGame.cs
Assets/Scripts/TetrisMap/Rooms/ItemRoomInGame.cs
+1
-1
DroppedLifeStone.cs
...Scripts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs
+1
-1
DroppedPotion.cs
...ts/Scripts/UI/In-game UI/LifeStoneScript/DroppedPotion.cs
+1
-1
LifeStoneFrame.cs
...s/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneFrame.cs
+1
-1
LifeStoneManager.cs
...Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
+1
-1
LifeStoneTest.cs
...ts/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
+1
-1
LifeUnitInFrame.cs
.../Scripts/UI/In-game UI/LifeStoneScript/LifeUnitInFrame.cs
+1
-1
No files found.
Assets/Prefabs/LifeStoneManager.prefab
0 → 100644
View file @
650f5e50
%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
:
1420923890547556
}
m_IsPrefabAsset
:
1
---
!u!1
&1420923890547556
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
4281661761445894
}
-
component
:
{
fileID
:
114772635349595938
}
m_Layer
:
0
m_Name
:
LifeStoneManager
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&4281661761445894
Transform
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1420923890547556
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-6.9766555
,
y
:
2.569394
,
z
:
0.0049343775
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&114772635349595938
MonoBehaviour
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1420923890547556
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
7fe540ec78947fc449eabc76bd87823d
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
lifeStoneLocation
:
{
x
:
7
,
y
:
7
}
standardImage
:
{
fileID
:
1001509239983906
,
guid
:
a48de94a6ab80f746aec69a02812f1e3
,
type
:
2
}
lifeStoneRowNum
:
6
lifeStoneSize
:
40
sprites
:
-
{
fileID
:
21300004
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
-
{
fileID
:
21300002
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
frameSuper
:
{
fileID
:
0
}
stoneSuper
:
{
fileID
:
0
}
lifeUnitPrefab
:
{
fileID
:
1274079429510600
,
guid
:
c1fa87a24452e5745859b739e4a5254b
,
type
:
2
}
goldPotionPrefab
:
{
fileID
:
1778675533210814
,
guid
:
57c0f65ad47e39943a69b5b0a6fa0e47
,
type
:
2
}
vibrationVariable
:
0.1
droppedLifeStonePrefab
:
{
fileID
:
1149595688849768
,
guid
:
8255a117a93935941b32b4aed9b299a0
,
type
:
2
}
frameBorder
:
0.2
popoutStrengthMultiplier
:
9
popoutTime
:
0.1
This diff is collapsed.
Click to expand it.
Assets/Prefabs/LifeStoneManager.prefab.meta
0 → 100644
View file @
650f5e50
fileFormatVersion: 2
guid: 7fec52078de87f74abe791494596a804
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Assets/Prefabs/UI/In-Game UI/LifeStoneUI.prefab
View file @
650f5e50
...
...
@@ -50,7 +50,6 @@ GameObject:
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
224402251087470820
}
-
component
:
{
fileID
:
114920782405449110
}
m_Layer
:
5
m_Name
:
LifeStoneUI
m_TagString
:
Untagged
...
...
@@ -69,38 +68,6 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
2674542376dfab04bad27caaa3ffe6a1
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!114
&114920782405449110
MonoBehaviour
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1939101680453256
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
7fe540ec78947fc449eabc76bd87823d
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
lifeStoneLocation
:
{
x
:
7
,
y
:
7
}
standardImage
:
{
fileID
:
1001509239983906
,
guid
:
a48de94a6ab80f746aec69a02812f1e3
,
type
:
2
}
lifeStoneRowNum
:
6
lifeStoneSize
:
40
sprites
:
-
{
fileID
:
21300004
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
-
{
fileID
:
21300002
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
frameSuper
:
{
fileID
:
1820862295034228
}
stoneSuper
:
{
fileID
:
1874721051176178
}
lifeUnitPrefab
:
{
fileID
:
1274079429510600
,
guid
:
c1fa87a24452e5745859b739e4a5254b
,
type
:
2
}
goldPotionPrefab
:
{
fileID
:
1778675533210814
,
guid
:
57c0f65ad47e39943a69b5b0a6fa0e47
,
type
:
2
}
vibrationVariable
:
0.1
droppedLifeStonePrefab
:
{
fileID
:
1149595688849768
,
guid
:
8255a117a93935941b32b4aed9b299a0
,
type
:
2
}
frameBorder
:
0.2
popoutStrengthMultiplier
:
9
popoutTime
:
0.1
---
!u!224
&224255635903845628
RectTransform
:
m_ObjectHideFlags
:
1
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/Characters/Enemy/Enemy.cs
View file @
650f5e50
...
...
@@ -50,7 +50,7 @@ public class Enemy : MonoBehaviour {
{
enemyManager
=
EnemyManager
.
Instance
;
inventoryManager
=
InventoryManager
.
Instance
;
lifeStoneManager
=
GameObject
.
Find
(
"UI Canvas"
).
transform
.
GetChild
(
0
).
GetComponent
<
LifeStoneManager
>()
;
lifeStoneManager
=
LifeStoneManager
.
Instance
;
animator
=
GetComponent
<
Animator
>();
}
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/Characters/Player.cs
View file @
650f5e50
...
...
@@ -13,7 +13,7 @@ public class Player : MonoBehaviour {
void
Start
()
{
ttx
=
(
int
)(
transform
.
position
.
x
/
24f
);
tty
=
(
int
)(
transform
.
position
.
y
-
0.9f
/
24f
);
lifeStoneManager
=
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>()
;
lifeStoneManager
=
LifeStoneManager
.
Instance
;
}
// Update is called once per frame
...
...
@@ -42,7 +42,7 @@ public class Player : MonoBehaviour {
}
ttx
=
tx
;
tty
=
ty
;
if
(
lifeStoneManager
.
CountType
(
LifeStoneType
.
Normal
)
+
lifeStoneManager
.
CountType
(
LifeStoneType
.
Gold
)
+
lifeStoneManager
.
CountType
(
LifeStoneType
.
Amethyst
)
==
0
)
if
(
lifeStoneManager
.
CountType
()
==
0
)
GameManager
.
gameState
=
GameState
.
GameOver
;
}
}
This diff is collapsed.
Click to expand it.
Assets/Scripts/Characters/PlayerAttack.cs
View file @
650f5e50
...
...
@@ -16,7 +16,7 @@ public class PlayerAttack : MonoBehaviour {
public
AnimatorOverrideController
aoc
;
public
AnimationClip
[]
normalAttack
=
new
AnimationClip
[
3
];
InventoryManager
inventoryManager
;
public
LifeStoneManager
lifeStoneManager
;
LifeStoneManager
lifeStoneManager
;
float
comboEndTime
;
bool
comboTimeOn
;
...
...
@@ -26,6 +26,7 @@ public class PlayerAttack : MonoBehaviour {
void
Awake
()
{
lifeStoneManager
=
LifeStoneManager
.
Instance
;
inventoryManager
=
InventoryManager
.
Instance
;
playerController
=
GetComponent
<
PlayerController
>();
attackProperty
=
GetComponentInChildren
<
AttackProperty
>();
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/Item/Addons/Gluttony.cs
View file @
650f5e50
...
...
@@ -16,7 +16,7 @@ public class Gluttony : Addon
sprite
=
Resources
.
Load
<
Sprite
>(
"Sprites/Addons/parchment piece"
);
;
highlight
=
Resources
.
Load
<
Sprite
>(
"Sprites/Addons/parchment piece"
);
;
sizeInventory
=
new
Vector2
(
80
,
80
);
lifeStoneManager
=
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>()
;
lifeStoneManager
=
LifeStoneManager
.
Instance
;
}
public
override
void
OtherEffect
(
PlayerAttackInfo
attackInfo
,
Enemy
enemyInfo
,
string
combo
)
{
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/Item/Addons/JanusCoin.cs
View file @
650f5e50
...
...
@@ -18,7 +18,7 @@ public class JanusCoin : Addon
}
public
override
float
DamageFinalAdder
(
PlayerAttackInfo
attackInfo
,
Enemy
enemyInfo
,
string
combo
)
{
LifeStoneManager
lifeStoneManager
=
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>()
;
LifeStoneManager
lifeStoneManager
=
LifeStoneManager
.
Instance
;
if
(
Random
.
Range
(
0
,
2
)
==
0
)
{
lifeStoneManager
.
DestroyStone
(
2
);
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/TetrisMap/MapManager.cs
View file @
650f5e50
...
...
@@ -1163,7 +1163,7 @@ public class MapManager : MonoBehaviour {
for (int i = 0; i < roomBackgroundSprite5.Length; i++)
roomBackgroundSpritesDistributed[4].Add(roomBackgroundSprite5[i]);*/
tetriminoSpawner
=
GameObject
.
Find
(
"TetriminoSpawner"
).
GetComponent
<
TetriminoSpawner
>();
lifeStoneManager
=
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>()
;
lifeStoneManager
=
LifeStoneManager
.
Instance
;
currentStage
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/TetrisMap/Rooms/ItemRoomInGame.cs
View file @
650f5e50
...
...
@@ -9,7 +9,7 @@ public class ItemRoomInGame : RoomInGame {
base
.
RoomEnter
();
Room
room
=
transform
.
parent
.
GetComponent
<
Room
>();
InventoryManager
inventoryManager
=
InventoryManager
.
Instance
;
LifeStoneManager
lifeStoneManager
=
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>()
;
LifeStoneManager
lifeStoneManager
=
LifeStoneManager
.
Instance
;
int
probability
=
Random
.
Range
(
0
,
100
);
Vector3
itemPosition
=
transform
.
Find
(
"item spot"
).
position
;
switch
(
room
.
itemRoomType
)
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs
View file @
650f5e50
...
...
@@ -52,7 +52,7 @@ public class DroppedLifeStone : MonoBehaviour, IPlayerInteraction
}
public
void
Apply
()
{
if
(
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>()
.
PushLifeStone
(
info
))
if
(
LifeStoneManager
.
Instance
.
PushLifeStone
(
info
))
Destroy
(
gameObject
);
}
public
void
HighlightSwitch
(
bool
enabled
)
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/UI/In-game UI/LifeStoneScript/DroppedPotion.cs
View file @
650f5e50
...
...
@@ -8,7 +8,7 @@ public class DroppedPotion : MonoBehaviour, IPlayerInteraction {
public
void
Apply
()
{
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>()
.
ChangeFromNormal
(
LifeStoneType
.
Gold
,
3
);
LifeStoneManager
.
Instance
.
ChangeFromNormal
(
LifeStoneType
.
Gold
,
3
);
Destroy
(
gameObject
);
}
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneFrame.cs
View file @
650f5e50
...
...
@@ -102,7 +102,7 @@ public class LifeStoneFrame : MonoBehaviour {
if
(
a
==
0
)
break
;
yield
return
null
;
}
StartCoroutine
(
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>()
.
VibrateEnumerator
(
30
));
StartCoroutine
(
LifeStoneManager
.
Instance
.
VibrateEnumerator
(
30
));
}
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
View file @
650f5e50
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
LifeStoneManager
:
MonoBehaviour
{
public
class
LifeStoneManager
:
Singleton
<
LifeStoneManager
>
{
/// <summary>
/// Location of lifeStoneFrame on Canvas
/// </summary>
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneTest.cs
View file @
650f5e50
...
...
@@ -13,7 +13,7 @@ public class LifeStoneTest : MonoBehaviour {
private
void
Start
()
{
uii
=
ui
.
GetComponent
<
LifeStoneManager
>()
;
uii
=
LifeStoneManager
.
Instance
;
}
public
void
push
()
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeUnitInFrame.cs
View file @
650f5e50
...
...
@@ -83,7 +83,7 @@ public class LifeUnitInFrame : MonoBehaviour {
transform
.
localPosition
=
new
Vector2
(
transform
.
localPosition
.
x
,
zeroPos
.
y
+
pos
.
y
*
size
);
if
(
vibration
!=
0
)
StartCoroutine
(
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>()
.
VibrateEnumerator
(
vibration
));
StartCoroutine
(
LifeStoneManager
.
Instance
.
VibrateEnumerator
(
vibration
));
}
}
This diff is collapsed.
Click to expand it.
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