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
80dcda1e
Commit
80dcda1e
authored
Jan 12, 2019
by
18류지석
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
드랍아이템 생명석 만듬, WIP PlayScene에 LifeStoneUI Scene에 올려야함
parent
771bfc7d
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
665 additions
and
12 deletions
+665
-12
DroppedLifeUnitPrefab.prefab
.../UI/In-Game UI/LifeCrystalUI/DroppedLifeUnitPrefab.prefab
+107
-0
DroppedLifeUnitPrefab.prefab.meta
...n-Game UI/LifeCrystalUI/DroppedLifeUnitPrefab.prefab.meta
+3
-3
LifeUnitHighlight.prefab
...fabs/UI/In-Game UI/LifeCrystalUI/LifeUnitHighlight.prefab
+88
-0
LifeUnitHighlight.prefab.meta
...UI/In-Game UI/LifeCrystalUI/LifeUnitHighlight.prefab.meta
+8
-0
LifeUnitSprite.prefab
...Prefabs/UI/In-Game UI/LifeCrystalUI/LifeUnitSprite.prefab
+88
-0
LifeUnitSprite.prefab.meta
...bs/UI/In-Game UI/LifeCrystalUI/LifeUnitSprite.prefab.meta
+8
-0
LifeStoneUI.prefab
Assets/Prefabs/UI/In-Game UI/LifeStoneUI.prefab
+8
-3
DroppedLifeStone.cs
...Scripts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs
+51
-0
DroppedLifeStone.cs.meta
...ts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs.meta
+11
-0
LifeStoneManager.cs
...Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
+104
-4
droppedlifestone.png
Assets/Sprites/LifeStone/droppedlifestone.png
+0
-0
droppedlifestone.png.meta
Assets/Sprites/LifeStone/droppedlifestone.png.meta
+181
-0
lifestone.png
Assets/Sprites/LifeStone/lifestone.png
+0
-0
TagManager.asset
ProjectSettings/TagManager.asset
+8
-2
No files found.
Assets/Prefabs/UI/In-Game UI/LifeCrystalUI/DroppedLifeUnitPrefab.prefab
0 → 100644
View file @
80dcda1e
%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
:
1149595688849768
}
m_IsPrefabAsset
:
1
---
!u!1
&1149595688849768
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
4464581980064214
}
-
component
:
{
fileID
:
50720349360822072
}
-
component
:
{
fileID
:
61973677923814376
}
-
component
:
{
fileID
:
114071444104977984
}
m_Layer
:
0
m_Name
:
DroppedLifeUnitPrefab
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&4464581980064214
Transform
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1149595688849768
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0.93
,
y
:
5.52
,
z
:
0
}
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!50
&50720349360822072
Rigidbody2D
:
serializedVersion
:
4
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1149595688849768
}
m_BodyType
:
0
m_Simulated
:
1
m_UseFullKinematicContacts
:
0
m_UseAutoMass
:
0
m_Mass
:
1
m_LinearDrag
:
0
m_AngularDrag
:
0.05
m_GravityScale
:
1
m_Material
:
{
fileID
:
0
}
m_Interpolate
:
0
m_SleepingMode
:
1
m_CollisionDetection
:
1
m_Constraints
:
4
---
!u!61
&61973677923814376
BoxCollider2D
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1149595688849768
}
m_Enabled
:
1
m_Density
:
1
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
0
m_UsedByEffector
:
0
m_UsedByComposite
:
0
m_Offset
:
{
x
:
0.125
,
y
:
0.125
}
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
:
0.25
,
y
:
0.25
}
m_EdgeRadius
:
0
---
!u!114
&114071444104977984
MonoBehaviour
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1149595688849768
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
13b50d2589d665a4aa9fa30cbf65eb55
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
sprites
:
-
{
fileID
:
21300000
,
guid
:
2e1b4071b5b523642aadd7947b85676e
,
type
:
3
}
-
{
fileID
:
21300002
,
guid
:
2e1b4071b5b523642aadd7947b85676e
,
type
:
3
}
-
{
fileID
:
21300004
,
guid
:
2e1b4071b5b523642aadd7947b85676e
,
type
:
3
}
unitSprite
:
{
fileID
:
1440159976580912
,
guid
:
672b38cc92ccf35439b6137b951daf15
,
type
:
2
}
highlightSprite
:
{
fileID
:
1638220072418960
,
guid
:
e279edc92751d234782d0cc881edfe87
,
type
:
2
}
Assets/
Animation/LifeStone/Animator
.meta
→
Assets/
Prefabs/UI/In-Game UI/LifeCrystalUI/DroppedLifeUnitPrefab.prefab
.meta
View file @
80dcda1e
fileFormatVersion: 2
guid: 5ffbdefea6526a243b9b1f898d7ef1d1
folderAsset: yes
DefaultImporter:
guid: 8255a117a93935941b32b4aed9b299a0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
Assets/Prefabs/UI/In-Game UI/LifeCrystalUI/LifeUnitHighlight.prefab
0 → 100644
View file @
80dcda1e
%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
:
1638220072418960
}
m_IsPrefabAsset
:
1
---
!u!1
&1638220072418960
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
4652270508485928
}
-
component
:
{
fileID
:
212024161364399972
}
m_Layer
:
14
m_Name
:
LifeUnitHighlight
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&4652270508485928
Transform
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1638220072418960
}
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_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!212
&212024161364399972
SpriteRenderer
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1638220072418960
}
m_Enabled
:
1
m_CastShadows
:
0
m_ReceiveShadows
:
0
m_DynamicOccludee
:
1
m_MotionVectors
:
1
m_LightProbeUsage
:
1
m_ReflectionProbeUsage
:
1
m_RenderingLayerMask
:
4294967295
m_Materials
:
-
{
fileID
:
10754
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_StaticBatchInfo
:
firstSubMesh
:
0
subMeshCount
:
0
m_StaticBatchRoot
:
{
fileID
:
0
}
m_ProbeAnchor
:
{
fileID
:
0
}
m_LightProbeVolumeOverride
:
{
fileID
:
0
}
m_ScaleInLightmap
:
1
m_PreserveUVs
:
0
m_IgnoreNormalsForChartDetection
:
0
m_ImportantGI
:
0
m_StitchLightmapSeams
:
0
m_SelectedEditorRenderState
:
0
m_MinimumChartSize
:
4
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
996861525
m_SortingLayer
:
2
m_SortingOrder
:
0
m_Sprite
:
{
fileID
:
21300006
,
guid
:
2e1b4071b5b523642aadd7947b85676e
,
type
:
3
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_FlipX
:
0
m_FlipY
:
0
m_DrawMode
:
0
m_Size
:
{
x
:
0.2
,
y
:
0.2
}
m_AdaptiveModeThreshold
:
0.5
m_SpriteTileMode
:
0
m_WasSpriteAssigned
:
1
m_MaskInteraction
:
0
m_SpriteSortPoint
:
0
Assets/Prefabs/UI/In-Game UI/LifeCrystalUI/LifeUnitHighlight.prefab.meta
0 → 100644
View file @
80dcda1e
fileFormatVersion: 2
guid: e279edc92751d234782d0cc881edfe87
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
Assets/Prefabs/UI/In-Game UI/LifeCrystalUI/LifeUnitSprite.prefab
0 → 100644
View file @
80dcda1e
%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
:
1440159976580912
}
m_IsPrefabAsset
:
1
---
!u!1
&1440159976580912
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
4153958457646730
}
-
component
:
{
fileID
:
212455254602000724
}
m_Layer
:
13
m_Name
:
LifeUnitSprite
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&4153958457646730
Transform
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1440159976580912
}
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_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!212
&212455254602000724
SpriteRenderer
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1440159976580912
}
m_Enabled
:
1
m_CastShadows
:
0
m_ReceiveShadows
:
0
m_DynamicOccludee
:
1
m_MotionVectors
:
1
m_LightProbeUsage
:
1
m_ReflectionProbeUsage
:
1
m_RenderingLayerMask
:
4294967295
m_Materials
:
-
{
fileID
:
10754
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_StaticBatchInfo
:
firstSubMesh
:
0
subMeshCount
:
0
m_StaticBatchRoot
:
{
fileID
:
0
}
m_ProbeAnchor
:
{
fileID
:
0
}
m_LightProbeVolumeOverride
:
{
fileID
:
0
}
m_ScaleInLightmap
:
1
m_PreserveUVs
:
0
m_IgnoreNormalsForChartDetection
:
0
m_ImportantGI
:
0
m_StitchLightmapSeams
:
0
m_SelectedEditorRenderState
:
0
m_MinimumChartSize
:
4
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
2145601713
m_SortingLayer
:
3
m_SortingOrder
:
0
m_Sprite
:
{
fileID
:
21300000
,
guid
:
2e1b4071b5b523642aadd7947b85676e
,
type
:
3
}
m_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
m_FlipX
:
0
m_FlipY
:
0
m_DrawMode
:
0
m_Size
:
{
x
:
0.2
,
y
:
0.2
}
m_AdaptiveModeThreshold
:
0.5
m_SpriteTileMode
:
0
m_WasSpriteAssigned
:
1
m_MaskInteraction
:
0
m_SpriteSortPoint
:
0
Assets/Prefabs/UI/In-Game UI/LifeCrystalUI/LifeUnitSprite.prefab.meta
0 → 100644
View file @
80dcda1e
fileFormatVersion: 2
guid: 672b38cc92ccf35439b6137b951daf15
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
Assets/Prefabs/UI/In-Game UI/LifeStoneUI.prefab
View file @
80dcda1e
...
...
@@ -71,16 +71,21 @@ MonoBehaviour:
lifeStoneLocation
:
{
x
:
7
,
y
:
7
}
standardImage
:
{
fileID
:
1001509239983906
,
guid
:
a48de94a6ab80f746aec69a02812f1e3
,
type
:
2
}
lifeStoneRow
:
8
lifeStoneSize
:
12
lifeStoneRow
Num
:
8
lifeStoneSize
:
20
sprites
:
-
{
fileID
:
21300004
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
-
{
fileID
:
21300002
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
eff441d843b9c664e97a81fcb39d8410
,
type
:
3
}
-
{
fileID
:
21300000
,
guid
:
c8304f5a15856324fa6a4c5ae11bd279
,
type
:
3
}
-
{
fileID
:
0
}
frameSuper
:
{
fileID
:
1820862295034228
}
stoneSuper
:
{
fileID
:
1874721051176178
}
lifeUnitPrefab
:
{
fileID
:
1274079429510600
,
guid
:
c1fa87a24452e5745859b739e4a5254b
,
type
:
2
}
vibrationVariable
:
0.08
lifeStoneFrame
:
{
fileID
:
0
}
droppedLifeStonePrefab
:
{
fileID
:
1149595688849768
,
guid
:
8255a117a93935941b32b4aed9b299a0
,
type
:
2
}
---
!u!224
&224255635903845628
RectTransform
:
m_ObjectHideFlags
:
1
...
...
Assets/Scripts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs
0 → 100644
View file @
80dcda1e
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
DroppedLifeStone
:
MonoBehaviour
{
LifeStoneInfo
info
;
public
Sprite
[]
sprites
;
public
GameObject
unitSprite
,
highlightSprite
;
float
unitSize
;
Rigidbody2D
rb2D
;
BoxCollider2D
bc2D
;
/// <summary>
/// unitSprite Objects
/// </summary>
GameObject
[]
unitObj
;
/// <summary>
/// highlightSprite Objects
/// </summary>
GameObject
[]
highObj
;
public
void
Init
(
LifeStoneInfo
_info
,
Vector3
pos
)
{
info
=
_info
;
rb2D
=
GetComponent
<
Rigidbody2D
>();
bc2D
=
GetComponent
<
BoxCollider2D
>();
unitSize
=
unitSprite
.
GetComponent
<
SpriteRenderer
>().
bounds
.
size
.
x
;
Vector2Int
inSize
=
info
.
getSize
();
string
inFill
=
info
.
getFill
();
unitObj
=
new
GameObject
[
inSize
.
x
*
inSize
.
y
];
highObj
=
new
GameObject
[
inSize
.
x
*
inSize
.
y
];
transform
.
position
=
pos
-
new
Vector3
(
inSize
.
x
*
unitSize
,
0
,
0
);
for
(
int
i
=
0
;
i
<
inSize
.
x
*
inSize
.
y
;
i
++)
{
if
(
inFill
[
i
]
!=
' '
)
{
unitObj
[
i
]
=
Instantiate
(
unitSprite
,
transform
);
unitObj
[
i
].
transform
.
localPosition
=
new
Vector3
((
i
%
inSize
.
x
)
*
unitSize
,
((
int
)(
i
/
inSize
.
x
))
*
unitSize
,
0
);
unitObj
[
i
].
GetComponent
<
SpriteRenderer
>().
sprite
=
sprites
[
inFill
[
i
]
-
'A'
];
highObj
[
i
]
=
Instantiate
(
highlightSprite
,
transform
);
highObj
[
i
].
transform
.
localPosition
=
unitObj
[
i
].
transform
.
localPosition
;
highObj
[
i
].
GetComponent
<
SpriteRenderer
>().
enabled
=
false
;
}
}
bc2D
.
offset
=
new
Vector2
(
unitSize
*
inSize
.
x
/
2f
,
unitSize
*
inSize
.
y
/
2f
);
bc2D
.
size
=
new
Vector2
(
unitSize
*
inSize
.
x
,
unitSize
*
inSize
.
y
);
}
}
Assets/Scripts/UI/In-game UI/LifeStoneScript/DroppedLifeStone.cs.meta
0 → 100644
View file @
80dcda1e
fileFormatVersion: 2
guid: 13b50d2589d665a4aa9fa30cbf65eb55
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
View file @
80dcda1e
...
...
@@ -54,7 +54,8 @@ public class LifeStoneManager : MonoBehaviour {
[
HideInInspector
]
public
GameObject
[,]
lifeStoneUnit
;
[
HideInInspector
]
public
LifeStoneFrame
lifeStoneFrame
;
public
GameObject
droppedLifeStonePrefab
;
void
Start
()
{
transform
.
position
=
new
Vector3
(
lifeStoneLocation
.
x
,
lifeStoneLocation
.
y
,
0
);
lifeStoneFrame
=
new
LifeStoneFrame
(
frameSuper
.
transform
,
standardImage
,
lifeStoneRowNum
,
lifeStoneSize
,
sprites
);
...
...
@@ -65,7 +66,15 @@ public class LifeStoneManager : MonoBehaviour {
}
IEnumerator
TestEnumerator
()
{
//PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 8), "AAAAAAAAAAAAAAAAAAAAAAAA"));
PushLifeStone
(
CreateLifeStoneInfo
(
5
,
0.2f
,
3
));
yield
return
new
WaitForSeconds
(
2
);
PushLifeStone
(
CreateLifeStoneInfo
(
3
,
0.2f
,
0
));
yield
return
new
WaitForSeconds
(
2
);
PushLifeStone
(
CreateLifeStoneInfo
(
4
,
0.2f
,
0
));
yield
return
new
WaitForSeconds
(
2
);
InstantiateDroppedLifeStone
(
CreateLifeStoneInfo
(
4
,
0.1f
,
0
),
GameObject
.
Find
(
"Player"
).
transform
.
position
+
new
Vector3
(
2
,
2
,
0
));
/*PushLifeStone(new LifeStoneInfo(new Vector2Int(3, 8), "AAAAAAAAAAAAAAAAAAAAAAAA"));
PushLifeStone(new LifeStoneInfo(new Vector2Int(2, 5), " AAAABA A "));
yield return new WaitForSeconds(2);
PushLifeStone(new LifeStoneInfo(new Vector2Int(2, 3), " AAA A"));
...
...
@@ -74,8 +83,99 @@ public class LifeStoneManager : MonoBehaviour {
yield return new WaitForSeconds(2);
ChangeToNormal(2, 3);
yield return new WaitForSeconds(2);
DestroyStone
(
3
);
}
DestroyStone(3);*/
}
public
void
InstantiateDroppedLifeStone
(
LifeStoneInfo
info
,
Vector3
pos
)
{
GameObject
tmpObj
=
Instantiate
(
droppedLifeStonePrefab
);
tmpObj
.
GetComponent
<
DroppedLifeStone
>().
Init
(
info
,
pos
);
}
public
LifeStoneInfo
CreateLifeStoneInfo
(
Vector2Int
size
,
int
num
,
float
goldPer
,
int
ameNum
)
{
System
.
Random
rnd
=
new
System
.
Random
();
num
=
Mathf
.
Max
(
1
,
num
);
size
.
y
=
Mathf
.
Min
(
3
,
size
.
y
);
if
(
num
>=
size
.
x
*
size
.
y
)
return
CreateLifeStoneInfo
(
size
,
goldPer
,
ameNum
);
int
[,]
tmpArray
=
new
int
[
size
.
y
,
size
.
x
]
;
for
(
int
j
=
0
;
j
<
size
.
y
;
j
++)
for
(
int
i
=
0
;
i
<
size
.
x
;
i
++)
tmpArray
[
j
,
i
]
=
0
;
tmpArray
[
rnd
.
Next
(
size
.
y
),
rnd
.
Next
(
size
.
x
)]
=
1
;
//making shape of lifestone
for
(
int
n
=
1
;
n
<
num
;
n
++)
{
ArrayList
candArray
=
new
ArrayList
();
for
(
int
j
=
0
;
j
<
size
.
y
;
j
++)
for
(
int
i
=
0
;
i
<
size
.
x
;
i
++)
//check if adjacent cell is lifestone
if
(
tmpArray
[
j
,
i
]
==
0
&&
(
j
-
1
>=
0
&&
tmpArray
[
j
-
1
,
i
]
==
1
||
j
+
1
<
size
.
y
&&
tmpArray
[
j
+
1
,
i
]
==
1
||
i
-
1
>=
0
&&
tmpArray
[
j
,
i
-
1
]
==
1
||
i
+
1
<
size
.
x
&&
tmpArray
[
j
,
i
+
1
]
==
1
))
candArray
.
Add
(
new
Vector2Int
(
i
,
j
));
if
(
candArray
.
Count
==
0
)
break
;
Vector2Int
vtmp
=
(
Vector2Int
)
candArray
[
rnd
.
Next
(
candArray
.
Count
)];
tmpArray
[
vtmp
.
y
,
vtmp
.
x
]
=
1
;
}
//recalibrate the size
Vector2Int
maxPoint
=
new
Vector2Int
(-
1
,
-
1
);
Vector2Int
minPoint
=
new
Vector2Int
(
size
.
x
+
1
,
size
.
y
+
1
);
for
(
int
j
=
0
;
j
<
size
.
y
;
j
++)
for
(
int
i
=
0
;
i
<
size
.
x
;
i
++)
if
(
tmpArray
[
j
,
i
]
==
1
)
{
maxPoint
.
x
=
Mathf
.
Max
(
i
,
maxPoint
.
x
);
maxPoint
.
y
=
Mathf
.
Max
(
j
,
maxPoint
.
y
);
minPoint
.
x
=
Mathf
.
Min
(
i
,
minPoint
.
x
);
minPoint
.
y
=
Mathf
.
Min
(
j
,
minPoint
.
y
);
}
size
=
maxPoint
-
minPoint
+
Vector2Int
.
one
;
//making fill string
string
fill
=
""
;
for
(
int
j
=
minPoint
.
y
;
j
<=
maxPoint
.
y
;
j
++)
for
(
int
i
=
minPoint
.
x
;
i
<=
maxPoint
.
x
;
i
++)
if
(
tmpArray
[
j
,
i
]
==
1
)
fill
+=
'A'
;
else
fill
+=
' '
;
//change to amethyst
ArrayList
sCandArray
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
fill
.
Length
;
i
++)
if
(
fill
[
i
]
==
'A'
)
sCandArray
.
Add
(
i
);
char
[]
repChar
=
fill
.
ToCharArray
();
for
(
int
i
=
0
;
i
<
ameNum
&&
sCandArray
.
Count
>
0
;
i
++)
{
int
tmp
=
rnd
.
Next
(
sCandArray
.
Count
);
repChar
[(
int
)
sCandArray
[
tmp
]]
=
'C'
;
sCandArray
.
RemoveAt
(
tmp
);
}
for
(
int
i
=
0
;
i
<
fill
.
Length
;
i
++)
if
(
repChar
[
i
]
==
'A'
&&
Random
.
Range
(
0f
,
1f
)
<
goldPer
)
repChar
[
i
]
=
'B'
;
fill
=
new
string
(
repChar
);
return
new
LifeStoneInfo
(
size
,
fill
);
}
public
LifeStoneInfo
CreateLifeStoneInfo
(
Vector2Int
size
,
float
goldPer
,
int
ameNum
)
{
return
CreateLifeStoneInfo
(
size
,
size
.
x
*
size
.
y
,
goldPer
,
ameNum
);
}
public
LifeStoneInfo
CreateLifeStoneInfo
(
int
num
,
float
goldPer
,
int
ameNum
)
{
return
CreateLifeStoneInfo
(
new
Vector2Int
(
3
,
20
),
num
,
goldPer
,
ameNum
);
}
public
LifeStoneInfo
CreateLifeStoneInfo
(
LifeStoneInfo
lifeStoneInfo
)
{
return
lifeStoneInfo
;
}
/// <summary>
/// push LifeStone in LifeStoneFrame
...
...
Assets/Sprites/LifeStone/droppedlifestone.png
0 → 100644
View file @
80dcda1e
2.91 KB
Assets/Sprites/LifeStone/droppedlifestone.png.meta
0 → 100644
View file @
80dcda1e
fileFormatVersion: 2
guid: 2e1b4071b5b523642aadd7947b85676e
TextureImporter:
fileIDToRecycleName:
21300000: droppedlifestone_0
21300002: droppedlifestone_1
21300004: droppedlifestone_2
21300006: droppedlifestone_3
externalObjects: {}
serializedVersion: 6
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 80
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
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:
- serializedVersion: 2
name: droppedlifestone_0
rect:
serializedVersion: 2
x: 0
y: 4
width: 20
height: 20
alignment: 6
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: fbe607b9b2046bd44a0016d4a39070be
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: droppedlifestone_1
rect:
serializedVersion: 2
x: 20
y: 4
width: 20
height: 20
alignment: 6
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: b09caa56b3578474a9faf9b09c8bf1d6
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: droppedlifestone_2
rect:
serializedVersion: 2
x: 40
y: 4
width: 20
height: 20
alignment: 6
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: b9bcc22852c1ed74b8ec2b07eb705257
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: droppedlifestone_3
rect:
serializedVersion: 2
x: 60
y: 0
width: 24
height: 24
alignment: 9
pivot: {x: 0.083333336, y: 0.083333336}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 18cb4633a5e8fd94dbdfbc2d0e9f3a07
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID: 642d689fd9711a84fbe662c564cd45f4
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
Assets/Sprites/LifeStone/lifestone.png
View replaced file @
771bfc7d
View file @
80dcda1e
1.87 KB
|
W:
|
H:
4.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ProjectSettings/TagManager.asset
View file @
80dcda1e
...
...
@@ -21,8 +21,8 @@ TagManager:
-
Spike
-
Platform
-
OuterWall
-
-
-
Item
-
ItemHighlight
-
-
-
...
...
@@ -47,3 +47,9 @@ TagManager:
-
name
:
UI
uniqueID
:
4254909397
locked
:
0
-
name
:
ItemHighlight
uniqueID
:
996861525
locked
:
0
-
name
:
Item
uniqueID
:
2145601713
locked
:
0
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