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
925e7ef2
Commit
925e7ef2
authored
Feb 24, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
아이템방에 아이템 스폰하는 데이터랑 상점에 나타나는 아이템 정보 csv 파일로 만들고 읽어들이게 만듦
parent
926ba458
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
117 additions
and
12 deletions
+117
-12
GoldRoomItemSpawnData.csv
Assets/Data/GoldRoomItemSpawnData.csv
+13
-0
GoldRoomItemSpawnData.csv.meta
Assets/Data/GoldRoomItemSpawnData.csv.meta
+7
-0
ItemRoomItemSpawnData.csv
Assets/Data/ItemRoomItemSpawnData.csv
+24
-0
ItemRoomItemSpawnData.csv.meta
Assets/Data/ItemRoomItemSpawnData.csv.meta
+7
-0
MapManager.prefab
Assets/Prefabs/MapManager.prefab
+4
-0
TestTools.prefab
Assets/Prefabs/TetrisMap/TestTools.prefab
+1
-1
Enumerators.cs
Assets/Scripts/Enumerators.cs
+1
-1
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+14
-2
Room.cs
Assets/Scripts/TetrisMap/Room.cs
+1
-0
RoomInGame.cs
Assets/Scripts/TetrisMap/RoomInGame.cs
+2
-3
GoldRoomInGame.cs
Assets/Scripts/TetrisMap/Rooms/GoldRoomInGame.cs
+1
-1
ItemRoomInGame.cs
Assets/Scripts/TetrisMap/Rooms/ItemRoomInGame.cs
+27
-0
Test.cs
Assets/Scripts/TetrisMap/Test.cs
+1
-1
12Background.png.meta
Assets/Sprites/Rooms/Background/12Background.png.meta
+14
-3
No files found.
Assets/Data/GoldRoomItemSpawnData.csv
0 → 100644
View file @
925e7ef2
stage,type,quality,price
1,LifeStone,None,4,LifeStone,None,10,Item,Study,4,Addon,Study,3,Item,Ordinary,10,Addon,Ordinary,10
2,LifeStone,None,4,LifeStone,None,10,Item,Study,4,Item,Ordinary,10,Item,Ordinary,10,Addon,Ordinary,10
3,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Addon,Ordinary,10,Item,Superior,10
3,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Addon,Ordinary,10,Addon,Superior,22
4,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Addon,Superior,22,Item,MasterPiece,50
4,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Item,Superior,22,Item,MasterPiece,50
4,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Addon,Superior,22,Addon,MasterPiece,50
4,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Item,Superior,22,Addon,MasterPiece,50
5,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Addon,Superior,22,Item,MasterPiece,50
5,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Item,Superior,22,Item,MasterPiece,50
5,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Addon,Superior,22,Addon,MasterPiece,50
5,LifeStone,None,4,LifeStone,None,10,Item,Ordinary,10,Addon,Ordinary,10,Item,Superior,22,Addon,MasterPiece,50
Assets/Data/GoldRoomItemSpawnData.csv.meta
0 → 100644
View file @
925e7ef2
fileFormatVersion: 2
guid: a89c82f77571a09438810f11ef1978e0
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Data/ItemRoomItemSpawnData.csv
0 → 100644
View file @
925e7ef2
itemstage,probability,type,quality,amount
1,12.5,Item,Ordinary,1,GoldPotion,None,2
1,12.5,Addon,Ordinary,1,GoldPotion,None,3
1,12.5,Item,Ordinary,1,LifeStone,Gold,1
1,12.5,Addon,Ordinary,1,LifeStone,Gold,1
1,17,Item,Ordinary,1,Addon,Ordinary,1
1,25,Item,Ordinary,1,Addon,Study,1
1,4,Item,Superior,1
1,4,Item,Superior,1
2,10,Item,Superior,1,GoldPotion,None,3
2,10,Addon,Superior,1,GoldPotion,None,3
2,20,Addon,Superior,1,Addon,Ordinary,1,Addon,Study,1
2,20,Item,Superior,1,Addon,Study,2
2,20,Item,Superior,1,Addon,Ordinary,1,LifeStone,None,1
2,10,Item,Superior,1,LifeStone,None,3
2,10,Addon,Superior,1,LifeStone,None,3
3,33.5,Item,Superior,1,Addon,Superior,1,Item,Ordinary,1,GoldPotion,None,1
3,34.5,Item,Superior,1,Addon,Superior,1,Addon,Ordinary,1,GoldPotion,None,1
3,16.5,Item,Masterpiece,1
3,16.5,Addon,Masterpiece,1
4,50,Item,Masterpiece,1,GoldPotion,None,2
4,50,Addon,Masterpiece,1,GoldPotion,None,2
5,50,Item,Masterpiece,1,LifeStoneFrame,None,1,LifeStone,Gold,1
5,50,Addon,Masterpiece,1,LifeStoneFrame,None,1,LifeStone,Gold,1
\ No newline at end of file
Assets/Data/ItemRoomItemSpawnData.csv.meta
0 → 100644
View file @
925e7ef2
fileFormatVersion: 2
guid: 50da557f52db710419c3374a903b3d22
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Prefabs/MapManager.prefab
View file @
925e7ef2
...
...
@@ -126,6 +126,10 @@ MonoBehaviour:
-
{
fileID
:
21300000
,
guid
:
7d94542039acd6a4b932cf9219b71799
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
c2e87589a128b824c8f621c5a34bfe5e
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
7d94542039acd6a4b932cf9219b71799
,
type
:
3
}
itemRoomItemSpawnData
:
{
fileID
:
4900000
,
guid
:
50da557f52db710419c3374a903b3d22
,
type
:
3
}
GoldRoomItemSpawnData
:
{
fileID
:
4900000
,
guid
:
a89c82f77571a09438810f11ef1978e0
,
type
:
3
}
---
!u!114
&114476419532778440
MonoBehaviour
:
m_ObjectHideFlags
:
1
...
...
Assets/Prefabs/TetrisMap/TestTools.prefab
View file @
925e7ef2
...
...
@@ -1594,7 +1594,7 @@ MonoBehaviour:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
114213890665286158
}
m_MethodName
:
Gold
m_MethodName
:
Item
m_Mode
:
1
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
...
...
Assets/Scripts/Enumerators.cs
View file @
925e7ef2
...
...
@@ -59,7 +59,7 @@ public enum ItemType
{
None
,
OneStone
,
TwoStone
,
ThreeStone
,
FourStone
,
FiveStone
,
GoldPotion
,
AmethystPotion
,
StudyItem
,
OrdinaryItem
,
SuperiorItem
,
Master
P
ieceItem
,
StudyAdd
,
OrdinaryAdd
,
SuperiorAdd
,
SuperiorItem
,
Master
p
ieceItem
,
StudyAdd
,
OrdinaryAdd
,
SuperiorAdd
,
MasterpieceAdd
,
LifeStoneFrame
}
...
...
Assets/Scripts/TetrisMap/MapManager.cs
View file @
925e7ef2
...
...
@@ -215,6 +215,17 @@ public class MapManager : Singleton<MapManager> {
public Sprite[] roomBackgroundSprite4;
public Sprite[] roomBackgroundSprite5;*/
/// <summary>
/// Data of which item to spawn in item room.
/// </summary>
[
SerializeField
]
private
TextAsset
itemRoomItemSpawnData
;
/// <summary>
/// Data of which item to spawn in gold room.
/// </summary>
[
SerializeField
]
private
TextAsset
GoldRoomItemSpawnData
;
/*
* functions
* */
...
...
@@ -988,7 +999,7 @@ public class MapManager : Singleton<MapManager> {
Tetrimino
.
rotationInformation
[
5
].
horizontalLength
=
new
int
[
4
]
{
3
,
2
,
3
,
2
};
//S
Tetrimino
.
rotationInformation
[
6
].
horizontalLength
=
new
int
[
4
]
{
3
,
2
,
3
,
2
};
//Z
Tetrimino
.
rotationInformation
[
7
].
horizontalLength
=
new
int
[
4
]
{
1
,
1
,
1
,
1
};
//Boss
ItemRoomInGame
.
itemRoomInformation
[
0
]
=
new
RoomItemInfo
<
ItemRoomItemInfo
>(
/*
ItemRoomInGame.itemRoomInformation[0] = new RoomItemInfo<ItemRoomItemInfo>(
new ItemRoomItemInfo[8]
{
new ItemRoomItemInfo(12.5f, new ItemSpawnType[2] { ItemSpawnType.Item, ItemSpawnType.GoldPotion },
...
...
@@ -1053,7 +1064,8 @@ public class MapManager : Singleton<MapManager> {
new ItemQuality[3] { ItemQuality.Masterpiece, ItemQuality.None, ItemQuality.Gold }, new int[3] { 1, 1, 1 }),
new ItemRoomItemInfo(50, new ItemSpawnType[3] { ItemSpawnType.Addon, ItemSpawnType.LifeStoneFrame, ItemSpawnType.LifeStone },
new ItemQuality[3] { ItemQuality.Masterpiece, ItemQuality.None, ItemQuality.Gold }, new int[3] { 1, 1, 1 })
});
});*/
ItemRoomInGame
.
LoadItemRoomData
(
itemRoomItemSpawnData
);
for
(
int
i
=
0
;
i
<
tetrisYCoord
.
Length
;
i
++)
tetrisYCoord
[
i
]
=
i
*
tetrisMapSize
;
for
(
int
i
=
0
;
i
<
isRowDeleting
.
Length
;
i
++)
...
...
Assets/Scripts/TetrisMap/Room.cs
View file @
925e7ef2
...
...
@@ -388,6 +388,7 @@ public class Room : MonoBehaviour
OpenDoor
(
"Left"
);
OpenDoor
(
"Right"
);
Vector3
fogPosition
=
fog
.
transform
.
position
;
Destroy
(
fog
.
gameObject
);
fog
=
Instantiate
(
MapManager
.
Instance
.
clearedFog
,
fogPosition
,
Quaternion
.
identity
,
transform
);
fog
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
CreatePortal
();
...
...
Assets/Scripts/TetrisMap/RoomInGame.cs
View file @
925e7ef2
...
...
@@ -9,10 +9,9 @@ public class RoomItemInfo<T>
{
}
public
RoomItemInfo
(
T
[]
_itemSpawnInfo
)
public
void
AddItemInfo
(
T
_itemSpawnInfo
)
{
for
(
int
i
=
0
;
i
<
_itemSpawnInfo
.
Length
;
i
++)
itemSpawnInfo
.
Add
(
_itemSpawnInfo
[
i
]);
itemSpawnInfo
.
Add
(
_itemSpawnInfo
);
}
}
...
...
Assets/Scripts/TetrisMap/Rooms/GoldRoomInGame.cs
View file @
925e7ef2
...
...
@@ -24,7 +24,7 @@ public class GoldRoomItemInfo
public
class
GoldRoomInGame
:
RoomInGame
{
public
static
RoomItemInfo
<
GoldRoomItemInfo
>[]
goldRoomInformation
=
new
RoomItemInfo
<
GoldRoomItemInfo
>
()[
];
public
static
RoomItemInfo
<
GoldRoomItemInfo
>[]
goldRoomInformation
=
new
RoomItemInfo
<
GoldRoomItemInfo
>
[
5
];
public
override
void
RoomEnter
()
{
...
...
Assets/Scripts/TetrisMap/Rooms/ItemRoomInGame.cs
View file @
925e7ef2
...
...
@@ -27,6 +27,33 @@ public class ItemRoomInGame : RoomInGame {
public
static
RoomItemInfo
<
ItemRoomItemInfo
>[]
itemRoomInformation
=
new
RoomItemInfo
<
ItemRoomItemInfo
>[
5
];
public
static
void
LoadItemRoomData
(
TextAsset
dataFile
)
{
for
(
int
i
=
0
;
i
<
itemRoomInformation
.
Length
;
i
++)
itemRoomInformation
[
i
]
=
new
RoomItemInfo
<
ItemRoomItemInfo
>();
string
[]
linesFromText
=
dataFile
.
text
.
Split
(
'\n'
);
string
[]
cellValue
=
null
;
int
stageIndex
=
0
;
int
probabilityIndex
=
1
;
int
skipDistance
=
2
;
for
(
int
i
=
1
;
i
<
linesFromText
.
Length
;
i
++)
{
cellValue
=
linesFromText
[
i
].
Split
(
','
);
int
itemCase
=
(
cellValue
.
Length
-
skipDistance
)
/
3
;
float
probability
=
float
.
Parse
(
cellValue
[
probabilityIndex
]);
ItemSpawnType
[]
itemType
=
new
ItemSpawnType
[
itemCase
];
ItemQuality
[]
itemQuality
=
new
ItemQuality
[
itemCase
];
int
[]
itemAmount
=
new
int
[
itemCase
];
for
(
int
j
=
0
;
j
<
itemCase
;
j
++)
{
itemType
[
j
]
=
(
ItemSpawnType
)
System
.
Enum
.
Parse
(
typeof
(
ItemSpawnType
),
cellValue
[
skipDistance
+
j
*
3
]);
itemQuality
[
j
]
=
(
ItemQuality
)
System
.
Enum
.
Parse
(
typeof
(
ItemQuality
),
cellValue
[
skipDistance
+
j
*
3
+
1
]);
itemAmount
[
j
]
=
int
.
Parse
(
cellValue
[
skipDistance
+
j
*
3
+
2
]);
}
itemRoomInformation
[
int
.
Parse
(
cellValue
[
stageIndex
])
-
1
].
AddItemInfo
(
new
ItemRoomItemInfo
(
probability
,
itemType
,
itemQuality
,
itemAmount
));
}
}
public
void
SpawnItem
()
{
Room
room
=
transform
.
parent
.
GetComponent
<
Room
>();
...
...
Assets/Scripts/TetrisMap/Test.cs
View file @
925e7ef2
...
...
@@ -53,7 +53,7 @@ public class Test : MonoBehaviour {
}
public
void
ClearRoom
()
{
MapManager
.
currentRoom
.
Clear
Room
();
MapManager
.
currentRoom
.
Finish
Room
();
}
public
void
SummonEnemy
()
{
...
...
Assets/Sprites/Rooms/Background/12Background.png.meta
View file @
925e7ef2
...
...
@@ -31,7 +31,7 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode:
-1
filterMode:
0
aniso: -1
mipBias: -100
wrapU: 1
...
...
@@ -43,9 +43,9 @@ TextureImporter:
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment:
0
alignment:
6
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits:
100
spritePixelsToUnits:
64
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
...
...
@@ -69,6 +69,17 @@ TextureImporter:
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
...
...
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