Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
FireballsClone
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9731021
FireballsClone
Commits
94759b2c
Commit
94759b2c
authored
Mar 11, 2021
by
Parsa Rahmaty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The nodes drop
parent
0833cbb3
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
230 additions
and
107 deletions
+230
-107
Stack Node.prefab
Assets/Prefabs/Stack Node.prefab
+34
-100
Stack Node.prefab.meta
Assets/Prefabs/Stack Node.prefab.meta
+1
-1
SampleScene.unity
Assets/Scenes/SampleScene.unity
+85
-5
Movable.cs
Assets/Scripts/General Purpose/Movable.cs
+30
-0
Movable.cs.meta
Assets/Scripts/General Purpose/Movable.cs.meta
+11
-0
GameEvents.cs
Assets/Scripts/Object Related/GameEvents.cs
+21
-0
GameEvents.cs.meta
Assets/Scripts/Object Related/GameEvents.cs.meta
+11
-0
Stack.cs
Assets/Scripts/Object Related/Stack.cs
+13
-1
StackNode.cs
Assets/Scripts/Object Related/StackNode.cs
+24
-0
No files found.
Assets/Prefabs/StackNode.prefab
→
Assets/Prefabs/Stack
Node.prefab
View file @
94759b2c
%YAML
1.1
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&
2813114490005280564
---
!u!1
&
8953703217792660207
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
...
@@ -8,50 +8,50 @@ GameObject:
...
@@ -8,50 +8,50 @@ GameObject:
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
serializedVersion
:
6
m_Component
:
m_Component
:
-
component
:
{
fileID
:
2813114490005280567
}
-
component
:
{
fileID
:
8953703217792660204
}
-
component
:
{
fileID
:
2813114490005280560
}
-
component
:
{
fileID
:
8953703217792660203
}
-
component
:
{
fileID
:
2813114490005280561
}
-
component
:
{
fileID
:
8953703217792660202
}
-
component
:
{
fileID
:
2813114490005280563
}
-
component
:
{
fileID
:
8953703217792660200
}
-
component
:
{
fileID
:
1469019900825895114
}
-
component
:
{
fileID
:
5704020906800342289
}
-
component
:
{
fileID
:
1239118069581175081
}
-
component
:
{
fileID
:
5366595633663589618
}
-
component
:
{
fileID
:
1551914874522532703
}
-
component
:
{
fileID
:
5675172427026800260
}
-
component
:
{
fileID
:
6082561672976095912
}
m_Layer
:
9
m_Layer
:
9
m_Name
:
StackNode
m_Name
:
Stack
Node
m_TagString
:
Untagged
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
m_IsActive
:
1
---
!u!4
&
2813114490005280567
---
!u!4
&
8953703217792660204
Transform
:
Transform
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2813114490005280564
}
m_GameObject
:
{
fileID
:
8953703217792660207
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
10
,
y
:
0.25
,
z
:
10
}
m_LocalScale
:
{
x
:
10
,
y
:
0.25
,
z
:
10
}
m_Children
:
m_Children
:
[]
-
{
fileID
:
6023010212252713845
}
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!33
&
2813114490005280560
---
!u!33
&
8953703217792660203
MeshFilter
:
MeshFilter
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2813114490005280564
}
m_GameObject
:
{
fileID
:
8953703217792660207
}
m_Mesh
:
{
fileID
:
10206
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
m_Mesh
:
{
fileID
:
10206
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
---
!u!23
&
2813114490005280561
---
!u!23
&
8953703217792660202
MeshRenderer
:
MeshRenderer
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2813114490005280564
}
m_GameObject
:
{
fileID
:
8953703217792660207
}
m_Enabled
:
1
m_Enabled
:
1
m_CastShadows
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_ReceiveShadows
:
1
...
@@ -84,39 +84,40 @@ MeshRenderer:
...
@@ -84,39 +84,40 @@ MeshRenderer:
m_SortingLayerID
:
0
m_SortingLayerID
:
0
m_SortingLayer
:
0
m_SortingLayer
:
0
m_SortingOrder
:
0
m_SortingOrder
:
0
---
!u!114
&
2813114490005280563
---
!u!114
&
8953703217792660200
MonoBehaviour
:
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2813114490005280564
}
m_GameObject
:
{
fileID
:
8953703217792660207
}
m_Enabled
:
1
m_Enabled
:
1
m_EditorHideFlags
:
0
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
8fa5977b14e9a8141884e3f5569471f6
,
type
:
3
}
m_Script
:
{
fileID
:
11500000
,
guid
:
8fa5977b14e9a8141884e3f5569471f6
,
type
:
3
}
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
rotationSpeed
:
20
rotationSpeed
:
20
---
!u!114
&1469019900825895114
descendTime
:
0.2
---
!u!114
&5704020906800342289
MonoBehaviour
:
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2813114490005280564
}
m_GameObject
:
{
fileID
:
8953703217792660207
}
m_Enabled
:
1
m_Enabled
:
1
m_EditorHideFlags
:
0
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
6af9c6b1989ec8b4985459fa969b2f02
,
type
:
3
}
m_Script
:
{
fileID
:
11500000
,
guid
:
6af9c6b1989ec8b4985459fa969b2f02
,
type
:
3
}
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
health
:
1
health
:
1
---
!u!54
&
1239118069581175081
---
!u!54
&
5366595633663589618
Rigidbody
:
Rigidbody
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2813114490005280564
}
m_GameObject
:
{
fileID
:
8953703217792660207
}
serializedVersion
:
2
serializedVersion
:
2
m_Mass
:
1
m_Mass
:
1
m_Drag
:
0
m_Drag
:
0
...
@@ -126,95 +127,28 @@ Rigidbody:
...
@@ -126,95 +127,28 @@ Rigidbody:
m_Interpolate
:
0
m_Interpolate
:
0
m_Constraints
:
90
m_Constraints
:
90
m_CollisionDetection
:
0
m_CollisionDetection
:
0
---
!u!65
&
1551914874522532703
---
!u!65
&
5675172427026800260
BoxCollider
:
BoxCollider
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
2813114490005280564
}
m_GameObject
:
{
fileID
:
8953703217792660207
}
m_Material
:
{
fileID
:
13400000
,
guid
:
767de626f0734e747b948a518e3e7918
,
type
:
2
}
m_Material
:
{
fileID
:
13400000
,
guid
:
767de626f0734e747b948a518e3e7918
,
type
:
2
}
m_IsTrigger
:
0
m_IsTrigger
:
0
m_Enabled
:
1
m_Enabled
:
1
serializedVersion
:
2
serializedVersion
:
2
m_Size
:
{
x
:
1.0000001
,
y
:
2
,
z
:
1.0000002
}
m_Size
:
{
x
:
1.0000001
,
y
:
2
,
z
:
1.0000002
}
m_Center
:
{
x
:
0.000000059604645
,
y
:
0
,
z
:
-0.00000008940697
}
m_Center
:
{
x
:
0.000000059604645
,
y
:
0
,
z
:
-0.00000008940697
}
---
!u!1
&5094898662465186538
---
!u!114
&6082561672976095912
GameObject
:
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
6023010212252713845
}
-
component
:
{
fileID
:
1203169594875834969
}
-
component
:
{
fileID
:
5788632802884759433
}
m_Layer
:
9
m_Name
:
Sphere
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&6023010212252713845
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
5094898662465186538
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0.682
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
0.1
,
y
:
4
,
z
:
0.1
}
m_Children
:
[]
m_Father
:
{
fileID
:
2813114490005280567
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!33
&1203169594875834969
MeshFilter
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
5094898662465186538
}
m_Mesh
:
{
fileID
:
10207
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
---
!u!23
&5788632802884759433
MeshRenderer
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
5094898662465186538
}
m_GameObject
:
{
fileID
:
8953703217792660207
}
m_Enabled
:
1
m_Enabled
:
1
m_CastShadows
:
1
m_EditorHideFlags
:
0
m_ReceiveShadows
:
1
m_Script
:
{
fileID
:
11500000
,
guid
:
e3cf5829d03eb97459c57901b7efff3d
,
type
:
3
}
m_DynamicOccludee
:
1
m_Name
:
m_MotionVectors
:
1
m_EditorClassIdentifier
:
m_LightProbeUsage
:
1
m_ReflectionProbeUsage
:
1
m_RayTracingMode
:
2
m_RenderingLayerMask
:
1
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
10303
,
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_ReceiveGI
:
1
m_PreserveUVs
:
0
m_IgnoreNormalsForChartDetection
:
0
m_ImportantGI
:
0
m_StitchLightmapSeams
:
1
m_SelectedEditorRenderState
:
3
m_MinimumChartSize
:
4
m_AutoUVMaxDistance
:
0.5
m_AutoUVMaxAngle
:
89
m_LightmapParameters
:
{
fileID
:
0
}
m_SortingLayerID
:
0
m_SortingLayer
:
0
m_SortingOrder
:
0
Assets/Prefabs/StackNode.prefab.meta
→
Assets/Prefabs/Stack
Node.prefab.meta
View file @
94759b2c
fileFormatVersion: 2
fileFormatVersion: 2
guid:
6673329a28c72c44a95878ed59481a5b
guid:
0f97df7b8a1fb3045acf290253e12f29
PrefabImporter:
PrefabImporter:
externalObjects: {}
externalObjects: {}
userData:
userData:
...
...
Assets/Scenes/SampleScene.unity
View file @
94759b2c
...
@@ -310,7 +310,7 @@ Transform:
...
@@ -310,7 +310,7 @@ Transform:
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
1
m_RootOrder
:
2
m_LocalEulerAnglesHint
:
{
x
:
50
,
y
:
-30
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
50
,
y
:
-30
,
z
:
0
}
---
!u!1
&768744112
---
!u!1
&768744112
GameObject
:
GameObject
:
...
@@ -341,7 +341,7 @@ Transform:
...
@@ -341,7 +341,7 @@ Transform:
m_Children
:
m_Children
:
-
{
fileID
:
58095959
}
-
{
fileID
:
58095959
}
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
4
m_RootOrder
:
5
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&963194225
---
!u!1
&963194225
GameObject
:
GameObject
:
...
@@ -705,7 +705,7 @@ Transform:
...
@@ -705,7 +705,7 @@ Transform:
-
{
fileID
:
1389915128
}
-
{
fileID
:
1389915128
}
-
{
fileID
:
1384577411
}
-
{
fileID
:
1384577411
}
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
2
m_RootOrder
:
3
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&1827272340
---
!u!114
&1827272340
MonoBehaviour
:
MonoBehaviour
:
...
@@ -725,6 +725,80 @@ MonoBehaviour:
...
@@ -725,6 +725,80 @@ MonoBehaviour:
cannonColliders
:
cannonColliders
:
-
{
fileID
:
1389915129
}
-
{
fileID
:
1389915129
}
-
{
fileID
:
1384577412
}
-
{
fileID
:
1384577412
}
---
!u!1
&1862334597
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1862334598
}
-
component
:
{
fileID
:
1862334599
}
m_Layer
:
0
m_Name
:
Game Events
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&1862334598
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1862334597
}
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
:
1871572808
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&1862334599
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1862334597
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
80a56d9f1a6c9ca4ebf74de39ef27528
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!1
&1871572807
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1871572808
}
m_Layer
:
0
m_Name
:
Game Manager
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&1871572808
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1871572807
}
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
:
-
{
fileID
:
1862334598
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&2140978673
---
!u!1
&2140978673
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -769,7 +843,7 @@ Transform:
...
@@ -769,7 +843,7 @@ Transform:
m_Children
:
m_Children
:
-
{
fileID
:
963194228
}
-
{
fileID
:
963194228
}
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_RootOrder
:
1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&2140978676
---
!u!114
&2140978676
MonoBehaviour
:
MonoBehaviour
:
...
@@ -828,7 +902,7 @@ Transform:
...
@@ -828,7 +902,7 @@ Transform:
m_Children
:
m_Children
:
-
{
fileID
:
1217394286
}
-
{
fileID
:
1217394286
}
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
3
m_RootOrder
:
4
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&2145345064
---
!u!114
&2145345064
MonoBehaviour
:
MonoBehaviour
:
...
@@ -915,5 +989,11 @@ PrefabInstance:
...
@@ -915,5 +989,11 @@ PrefabInstance:
propertyPath
:
m_Name
propertyPath
:
m_Name
value
:
Node Holder
value
:
Node Holder
objectReference
:
{
fileID
:
0
}
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4028788090995854451
,
guid
:
90b16e9d09448504aa823b8ca0032ddf
,
type
:
3
}
propertyPath
:
stackNodeObject
value
:
objectReference
:
{
fileID
:
5704020906800342289
,
guid
:
0f97df7b8a1fb3045acf290253e12f29
,
type
:
3
}
m_RemovedComponents
:
[]
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
90b16e9d09448504aa823b8ca0032ddf
,
type
:
3
}
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
90b16e9d09448504aa823b8ca0032ddf
,
type
:
3
}
Assets/Scripts/General Purpose/Movable.cs
0 → 100644
View file @
94759b2c
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Movable
:
MonoBehaviour
{
private
Vector3
startPosition
;
public
Vector3
targetPosition
{
get
;
private
set
;
}
private
float
time
;
private
float
timeToReachTarget
;
void
Start
()
{
startPosition
=
targetPosition
=
transform
.
position
;
}
void
Update
()
{
time
+=
Time
.
deltaTime
/
timeToReachTarget
;
transform
.
position
=
Vector3
.
Lerp
(
startPosition
,
targetPosition
,
time
);
}
public
void
SetDestination
(
Vector3
destination
,
float
time
)
{
this
.
time
=
0
;
startPosition
=
transform
.
position
;
timeToReachTarget
=
time
;
targetPosition
=
destination
;
}
}
Assets/Scripts/General Purpose/Movable.cs.meta
0 → 100644
View file @
94759b2c
fileFormatVersion: 2
guid: e3cf5829d03eb97459c57901b7efff3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Object Related/GameEvents.cs
0 → 100644
View file @
94759b2c
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
GameEvents
:
MonoBehaviour
{
[
HideInInspector
]
public
static
GameEvents
instance
;
private
void
Awake
()
{
instance
=
this
;
}
public
event
Action
onHitEvent
;
public
void
TriggerOnHitEvent
()
{
onHitEvent
?.
Invoke
();
}
}
Assets/Scripts/Object Related/GameEvents.cs.meta
0 → 100644
View file @
94759b2c
fileFormatVersion: 2
guid: 80a56d9f1a6c9ca4ebf74de39ef27528
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Object Related/Stack.cs
View file @
94759b2c
...
@@ -4,7 +4,7 @@ using UnityEngine;
...
@@ -4,7 +4,7 @@ using UnityEngine;
public
class
Stack
:
MonoBehaviour
public
class
Stack
:
MonoBehaviour
{
{
public
int
numberOfNodes
;
[
SerializeField
]
private
int
numberOfNodes
;
[
HideInInspector
]
public
int
nodesLeft
;
[
HideInInspector
]
public
int
nodesLeft
;
private
NodeHolder
nodeHolder
=
null
;
private
NodeHolder
nodeHolder
=
null
;
...
@@ -12,6 +12,12 @@ public class Stack : MonoBehaviour
...
@@ -12,6 +12,12 @@ public class Stack : MonoBehaviour
void
Awake
()
void
Awake
()
{
{
nodeHolder
=
gameObject
.
transform
.
GetChild
(
0
).
GetComponent
<
NodeHolder
>();
nodeHolder
=
gameObject
.
transform
.
GetChild
(
0
).
GetComponent
<
NodeHolder
>();
refreshStack
(
numberOfNodes
);
}
private
void
refreshStack
(
int
nodeCount
)
{
numberOfNodes
=
nodesLeft
=
nodeCount
;
nodeHolder
.
MakeNodes
(
numberOfNodes
);
nodeHolder
.
MakeNodes
(
numberOfNodes
);
}
}
...
@@ -19,10 +25,16 @@ public class Stack : MonoBehaviour
...
@@ -19,10 +25,16 @@ public class Stack : MonoBehaviour
{
{
if
(
collision
.
gameObject
.
tag
==
"Cannonball"
)
if
(
collision
.
gameObject
.
tag
==
"Cannonball"
)
{
{
GameEvents
.
instance
.
TriggerOnHitEvent
();
// Destroy the last stack node
// Destroy the last stack node
Destroy
(
collision
.
gameObject
);
Destroy
(
collision
.
gameObject
);
nodeHolder
.
RemoveBottomNode
();
nodeHolder
.
RemoveBottomNode
();
nodesLeft
--;
nodesLeft
--;
if
(
nodesLeft
==
0
)
{
refreshStack
((
int
)(
numberOfNodes
*
1.5f
));
}
}
}
}
}
}
}
Assets/Scripts/Object Related/StackNode.cs
View file @
94759b2c
...
@@ -5,9 +5,33 @@ using UnityEngine;
...
@@ -5,9 +5,33 @@ using UnityEngine;
public
class
StackNode
:
MonoBehaviour
public
class
StackNode
:
MonoBehaviour
{
{
[
SerializeField
]
private
float
rotationSpeed
=
10f
;
[
SerializeField
]
private
float
rotationSpeed
=
10f
;
[
SerializeField
]
private
float
descendTime
=
0.2f
;
private
float
descendDistance
=
0.5f
;
private
Movable
movable
;
private
void
Awake
()
{
movable
=
gameObject
.
GetComponent
<
Movable
>();
}
void
Start
()
{
GameEvents
.
instance
.
onHitEvent
+=
Descend
;
}
void
FixedUpdate
()
void
FixedUpdate
()
{
{
transform
.
localEulerAngles
+=
new
Vector3
(
0f
,
rotationSpeed
*
Time
.
fixedDeltaTime
,
0f
);
transform
.
localEulerAngles
+=
new
Vector3
(
0f
,
rotationSpeed
*
Time
.
fixedDeltaTime
,
0f
);
}
}
private
void
Descend
()
{
movable
.
SetDestination
(
movable
.
targetPosition
-
new
Vector3
(
0f
,
descendDistance
,
0f
),
descendTime
);
}
private
void
OnDestroy
()
{
GameEvents
.
instance
.
onHitEvent
-=
Descend
;
}
}
}
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