Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
WidowmakerSimulator
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
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
15박보승
WidowmakerSimulator
Commits
c184c282
Commit
c184c282
authored
5 years ago
by
15박보승
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
플레이어 체력/비행선 적과 미사일 구현
parent
ed5b95ee
Changes
25
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1208 additions
and
226 deletions
+1208
-226
Missile.prefab
Grapplers/Assets/Prefabs/Missile.prefab
+242
-0
Missile.prefab.meta
Grapplers/Assets/Prefabs/Missile.prefab.meta
+7
-0
SampleScene.unity
Grapplers/Assets/Scenes/SampleScene.unity
+297
-214
CameraController.cs
Grapplers/Assets/Scripts/CameraController.cs
+28
-9
Enemy.meta
Grapplers/Assets/Scripts/Enemy.meta
+1
-1
AirplaneEnemy.cs
Grapplers/Assets/Scripts/Enemy/AirplaneEnemy.cs
+30
-0
AirplaneEnemy.cs.meta
Grapplers/Assets/Scripts/Enemy/AirplaneEnemy.cs.meta
+11
-0
Enemy.cs
Grapplers/Assets/Scripts/Enemy/Enemy.cs
+154
-0
Enemy.cs.meta
Grapplers/Assets/Scripts/Enemy/Enemy.cs.meta
+0
-0
IProjectile.cs
Grapplers/Assets/Scripts/Enemy/IProjectile.cs
+18
-0
IProjectile.cs.meta
Grapplers/Assets/Scripts/Enemy/IProjectile.cs.meta
+11
-0
Missile.cs
Grapplers/Assets/Scripts/Enemy/Missile.cs
+28
-0
Missile.cs.meta
Grapplers/Assets/Scripts/Enemy/Missile.cs.meta
+11
-0
IngameUIManager.cs
Grapplers/Assets/Scripts/IngameUIManager.cs
+8
-1
PlayerController.cs
Grapplers/Assets/Scripts/PlayerController.cs
+43
-0
StateMachine.cs
Grapplers/Assets/Scripts/StateMachine.cs
+43
-0
StateMachine.cs.meta
Grapplers/Assets/Scripts/StateMachine.cs.meta
+11
-0
Solid.meta
Grapplers/Assets/Solid.meta
+8
-0
Floor.mat
Grapplers/Assets/Solid/Floor.mat
+77
-0
Floor.mat.meta
Grapplers/Assets/Solid/Floor.mat.meta
+8
-0
Missile.mat
Grapplers/Assets/Solid/Missile.mat
+77
-0
Missile.mat.meta
Grapplers/Assets/Solid/Missile.mat.meta
+8
-0
Rock.mat
Grapplers/Assets/Solid/Rock.mat
+77
-0
Rock.mat.meta
Grapplers/Assets/Solid/Rock.mat.meta
+8
-0
TagManager.asset
Grapplers/ProjectSettings/TagManager.asset
+2
-1
No files found.
Grapplers/Assets/Prefabs/Missile.prefab
0 → 100644
View file @
c184c282
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&6757045588236739288
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
6757045588236739293
}
-
component
:
{
fileID
:
6757045588236739292
}
-
component
:
{
fileID
:
6757045588236739295
}
-
component
:
{
fileID
:
6757045588236739294
}
-
component
:
{
fileID
:
6757045588236739289
}
-
component
:
{
fileID
:
13760249356785958
}
-
component
:
{
fileID
:
2326824299361811505
}
m_Layer
:
10
m_Name
:
Missile
m_TagString
:
Enemy
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&6757045588236739293
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6757045588236739288
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
-0.019395113
,
y
:
1.97188
,
z
:
15.06
}
m_LocalScale
:
{
x
:
0.25
,
y
:
0.25
,
z
:
0.25
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!33
&6757045588236739292
MeshFilter
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6757045588236739288
}
m_Mesh
:
{
fileID
:
10202
,
guid
:
0000000000000000e000000000000000
,
type
:
0
}
---
!u!23
&6757045588236739295
MeshRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6757045588236739288
}
m_Enabled
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_MotionVectors
:
1
m_LightProbeUsage
:
1
m_ReflectionProbeUsage
:
1
m_RenderingLayerMask
:
1
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
2100000
,
guid
:
96565613c36fe2545aa8384b0a0c4ab3
,
type
:
2
}
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
---
!u!65
&6757045588236739294
BoxCollider
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6757045588236739288
}
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
1
m_Enabled
:
1
serializedVersion
:
2
m_Size
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Center
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&6757045588236739289
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6757045588236739288
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
5290cf3af93d2e046946f57c80c919bb
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
maxHealth
:
5
curHealth
:
0
attackDamage
:
5
detectRange
:
0
moveSpeed
:
0.1
playerMask
:
serializedVersion
:
2
m_Bits
:
256
projectilePrefab
:
{
fileID
:
0
}
bloodEffect
:
{
fileID
:
0
}
shotSpeed
:
0
shotTimeInterval
:
0
---
!u!54
&13760249356785958
Rigidbody
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6757045588236739288
}
serializedVersion
:
2
m_Mass
:
1
m_Drag
:
0
m_AngularDrag
:
0.05
m_UseGravity
:
0
m_IsKinematic
:
0
m_Interpolate
:
0
m_Constraints
:
0
m_CollisionDetection
:
0
---
!u!96
&2326824299361811505
TrailRenderer
:
serializedVersion
:
2
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6757045588236739288
}
m_Enabled
:
1
m_CastShadows
:
1
m_ReceiveShadows
:
1
m_DynamicOccludee
:
1
m_MotionVectors
:
1
m_LightProbeUsage
:
0
m_ReflectionProbeUsage
:
0
m_RenderingLayerMask
:
1
m_RendererPriority
:
0
m_Materials
:
-
{
fileID
:
10306
,
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
m_Time
:
1
m_Parameters
:
serializedVersion
:
3
widthMultiplier
:
0.25
widthCurve
:
serializedVersion
:
2
m_Curve
:
-
serializedVersion
:
3
time
:
0
value
:
1
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0.33333334
outWeight
:
0.33333334
-
serializedVersion
:
3
time
:
1
value
:
0
inSlope
:
0
outSlope
:
0
tangentMode
:
0
weightedMode
:
0
inWeight
:
0
outWeight
:
0
m_PreInfinity
:
2
m_PostInfinity
:
2
m_RotationOrder
:
4
colorGradient
:
serializedVersion
:
2
key0
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
key1
:
{
r
:
1
,
g
:
0
,
b
:
0
,
a
:
0
}
key2
:
{
r
:
1
,
g
:
0
,
b
:
0
,
a
:
0
}
key3
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key4
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key5
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key6
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
key7
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
}
ctime0
:
0
ctime1
:
1735
ctime2
:
65535
ctime3
:
0
ctime4
:
0
ctime5
:
0
ctime6
:
0
ctime7
:
0
atime0
:
0
atime1
:
65535
atime2
:
0
atime3
:
0
atime4
:
0
atime5
:
0
atime6
:
0
atime7
:
0
m_Mode
:
0
m_NumColorKeys
:
3
m_NumAlphaKeys
:
2
numCornerVertices
:
0
numCapVertices
:
0
alignment
:
0
textureMode
:
0
shadowBias
:
0.5
generateLightingData
:
0
m_MinVertexDistance
:
0.1
m_Autodestruct
:
0
m_Emitting
:
1
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Prefabs/Missile.prefab.meta
0 → 100644
View file @
c184c282
fileFormatVersion: 2
guid: f5523fdf30a86e84ea4d7fd5aa020ca2
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scenes/SampleScene.unity
View file @
c184c282
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/CameraController.cs
View file @
c184c282
...
...
@@ -17,6 +17,9 @@ public class CameraController : MonoBehaviour
private
Camera
cam
;
[
SerializeField
]
private
LayerMask
blockMask
;
private
void
Start
()
{
cam
=
GetComponent
<
Camera
>();
...
...
@@ -26,14 +29,30 @@ public class CameraController : MonoBehaviour
{
currentX
+=
Input
.
GetAxis
(
"Mouse X"
);
currentY
=
Mathf
.
Clamp
(
currentY
-
Input
.
GetAxis
(
"Mouse Y"
),
-
89
,
89
);
}
private
void
LateUpdate
()
{
Vector3
dir
=
new
Vector3
(
0
,
0
,
-
distance
);
Quaternion
rotation
=
Quaternion
.
Euler
(
currentY
,
currentX
,
0
);
transform
.
position
=
/*offset +*/
target
.
position
+
rotation
*
dir
;
transform
.
position
=
target
.
position
+
rotation
*
new
Vector3
(
0
,
0
,
-
distance
);
target
.
rotation
=
Quaternion
.
Euler
(
0
,
currentX
,
0
);
transform
.
LookAt
(
target
.
position
+
offset
);
/*
//Vector3 direction = rotation * Vector3.back;
//Debug.Log(rotation.eulerAngles);
float dist;
RaycastHit hit;
if (Physics.Raycast(target.position + offset, -transform.forward, out hit, distance, blockMask))
dist = Mathf.Max(1, hit.distance);
else
dist = distance;
transform.position = target.position + -transform.forward * dist;
target.rotation = Quaternion.Euler(0, currentX, 0);
transform.LookAt(target.position + offset);
*/
}
private
void
LateUpdate
()
{
}
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/
Materials
.meta
→
Grapplers/Assets/
Scripts/Enemy
.meta
View file @
c184c282
fileFormatVersion: 2
guid:
19ac9e1f5954f44458c34d427b8ce316
guid:
c3ff7110959368d45aee23db6ab8fa4a
folderAsset: yes
DefaultImporter:
externalObjects: {}
...
...
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/Enemy/AirplaneEnemy.cs
0 → 100644
View file @
c184c282
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
AirplaneEnemy
:
Enemy
{
private
float
shotTimer
=
5
;
protected
override
void
InitializeStateMachine
()
{
State
idle
=
new
State
(
"idle"
);
State
detected
=
new
State
(
"detected"
);
State
attack
=
new
State
(
"attack"
);
idle
.
StateUpdate
+=
delegate
{
if
(
DetectPlayer
())
{
stateMachine
.
Transtion
(
"detected"
);
}
};
detected
.
StateUpdate
+=
ShotProjectile
;
State
[]
states
=
{
idle
,
detected
,
attack
};
stateMachine
.
AddNewStates
(
states
);
stateMachine
.
Transtion
(
"idle"
);
}
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/Enemy/AirplaneEnemy.cs.meta
0 → 100644
View file @
c184c282
fileFormatVersion: 2
guid: c85a502201043ea4585ced1c522431cb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/Enemy.cs
→
Grapplers/Assets/Scripts/Enemy
/Enemy
.cs
View file @
c184c282
...
...
@@ -3,14 +3,22 @@ using System.Collections.Generic;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
Enemy
:
MonoBehaviour
public
abstract
class
Enemy
:
MonoBehaviour
{
[
SerializeField
]
private
int
maxHealth
;
[
SerializeField
]
private
int
curHealth
;
private
MeshRenderer
meshRenderer
;
[
SerializeField
]
protected
int
attackDamage
;
[
SerializeField
]
private
float
detectRange
;
[
SerializeField
]
protected
float
moveSpeed
;
[
SerializeField
]
private
LayerMask
playerMask
;
[
SerializeField
]
private
GameObject
projectilePrefab
;
[
SerializeField
]
private
ParticleSystem
bloodEffect
;
...
...
@@ -20,15 +28,34 @@ public class Enemy : MonoBehaviour
private
Collider
col
;
protected
StateMachine
stateMachine
=
new
StateMachine
();
protected
PlayerController
target
;
[
SerializeField
]
private
float
shotSpeed
;
[
SerializeField
]
private
float
shotTimeInterval
;
private
float
shotTimer
;
#if UNITY_EDITOR
private
void
OnDrawGizmos
()
{
Gizmos
.
color
=
Color
.
cyan
;
Gizmos
.
DrawWireSphere
(
transform
.
position
,
detectRange
);
}
#endif
private
void
Start
()
{
meshRenderer
=
GetComponent
<
MeshRenderer
>();
col
=
GetComponent
<
Collider
>();
curHealth
=
maxHealth
;
InitializeStateMachine
();
}
private
void
Update
()
{
stateMachine
.
curState
?.
StateUpdate
();
UpdateHealthUIRect
();
}
...
...
@@ -47,16 +74,19 @@ public class Enemy : MonoBehaviour
private
void
Dead
()
{
Debug
.
Log
(
gameObject
+
" : DEAD!"
);
GetComponent
<
Rigidbody
>().
useGravity
=
false
;
Rigidbody
rb
=
GetComponent
<
Rigidbody
>();
if
(
rb
!=
null
)
rb
.
useGravity
=
false
;
GetComponent
<
Collider
>().
enabled
=
false
;
if
(
healthUI
!=
null
)
Destroy
(
healthUI
.
gameObject
);
Destroy
(
gameObject
,
5
);
Destroy
(
gameObject
);
}
private
IEnumerator
DamageRoutine
()
{
bloodEffect
?.
Play
();
if
(
bloodEffect
!=
null
)
bloodEffect
.
Play
();
yield
return
null
;
}
...
...
@@ -82,4 +112,43 @@ public class Enemy : MonoBehaviour
healthUIRect
.
anchorMax
=
viewportPoint
;
healthUIRect
.
anchorMin
=
viewportPoint
;
}
protected
bool
DetectPlayer
()
{
var
detectResults
=
Physics
.
OverlapSphere
(
transform
.
position
,
detectRange
,
playerMask
);
if
(
detectResults
.
Length
>
0
)
{
target
=
detectResults
[
0
].
GetComponent
<
PlayerController
>();
return
true
;
}
return
false
;
}
protected
void
GiveDamageToPlayer
()
{
target
.
GetDamaged
(
attackDamage
);
}
protected
virtual
void
ShotProjectile
()
{
shotTimer
-=
Time
.
deltaTime
;
if
(
shotTimer
<=
0
)
{
shotTimer
=
shotTimeInterval
;
Vector3
shotDirection
=
(
target
.
transform
.
position
-
transform
.
position
).
normalized
;
Instantiate
(
projectilePrefab
,
transform
.
position
,
transform
.
rotation
)
.
GetComponent
<
Enemy
>().
SetTarget
(
target
);
}
}
public
void
SetTarget
(
PlayerController
pc
)
{
target
=
pc
;
}
protected
virtual
void
Initialize
()
{
InitializeStateMachine
();
}
protected
abstract
void
InitializeStateMachine
();
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/Enemy.cs.meta
→
Grapplers/Assets/Scripts/Enemy
/Enemy
.cs.meta
View file @
c184c282
File moved
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/Enemy/IProjectile.cs
0 → 100644
View file @
c184c282
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
IProjectile
:
MonoBehaviour
{
// Start is called before the first frame update
void
Start
()
{
}
// Update is called once per frame
void
Update
()
{
}
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/Enemy/IProjectile.cs.meta
0 → 100644
View file @
c184c282
fileFormatVersion: 2
guid: e016a97cde2fae840bf5c5deec5f5565
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/Enemy/Missile.cs
0 → 100644
View file @
c184c282
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Missile
:
Enemy
{
protected
override
void
InitializeStateMachine
()
{
State
idle
=
new
State
(
"idle"
);
idle
.
StateUpdate
+=
delegate
{
transform
.
position
+=
(
target
.
transform
.
position
-
transform
.
position
).
normalized
*
moveSpeed
;
};
stateMachine
.
AddNewState
(
idle
);
stateMachine
.
Transtion
(
"idle"
);
}
private
void
OnTriggerEnter
(
Collider
other
)
{
Debug
.
Log
(
other
);
if
(
other
.
tag
.
Contains
(
"Enemy"
))
return
;
other
.
GetComponent
<
PlayerController
>()?.
GetDamaged
(
attackDamage
);
Destroy
(
gameObject
);
}
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/Enemy/Missile.cs.meta
0 → 100644
View file @
c184c282
fileFormatVersion: 2
guid: 5290cf3af93d2e046946f57c80c919bb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/IngameUIManager.cs
View file @
c184c282
...
...
@@ -17,6 +17,9 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
[
SerializeField
]
private
GameObject
enemyHealthUIPrefab
;
[
SerializeField
]
private
Slider
playerHealthUI
;
public
void
UpdateTargetLockedUIs
(
Vector3
[]
pos
)
{
int
tmp
,
i
=
0
;
...
...
@@ -67,6 +70,10 @@ public class IngameUIManager : SingletonBehaviour<IngameUIManager>
if
(
ui
==
null
)
Debug
.
LogError
(
"There's no health ui available"
);
ui
.
value
=
curHealth
/
(
float
)
maxHealth
;
Debug
.
Log
(
ui
.
value
);
}
public
void
UpdatePlayerHealthUI
(
int
maxHealth
,
int
curHealth
)
{
playerHealthUI
.
value
=
(
float
)
curHealth
/
maxHealth
;
}
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/PlayerController.cs
View file @
c184c282
...
...
@@ -40,6 +40,20 @@ public class PlayerController : MonoBehaviour
[
SerializeField
]
private
LayerMask
bulletBlockMask
;
public
int
MaxHealth
{
get
;
private
set
;
}
private
int
_health
;
public
int
Health
{
get
{
return
_health
;
}
private
set
{
_health
=
value
;
IngameUIManager
.
inst
.
UpdatePlayerHealthUI
(
MaxHealth
,
_health
);
}
}
#if UNITY_EDITOR
private
void
OnDrawGizmos
()
{
...
...
@@ -61,6 +75,8 @@ public class PlayerController : MonoBehaviour
//col.enabled = !IsGrounded;
//cc.enabled = IsGrounded;
MaxHealth
=
Health
=
100
;
}
private
void
Update
()
{
...
...
@@ -151,4 +167,31 @@ public class PlayerController : MonoBehaviour
isWired
=
true
;
rb
.
useGravity
=
false
;
}
public
void
GetDamaged
(
int
damage
)
{
Health
=
Mathf
.
Max
(
0
,
Health
-
damage
);
}
}
public
interface
IWeapon
{
void
UseWeapon
();
}
public
class
Gun
:
IWeapon
{
public
void
UseWeapon
()
{
throw
new
System
.
NotImplementedException
();
}
}
public
class
Weapon
:
IWeapon
{
public
void
UseWeapon
()
{
throw
new
System
.
NotImplementedException
();
}
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/StateMachine.cs
0 → 100644
View file @
c184c282
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
StateMachine
{
private
Dictionary
<
string
,
State
>
states
=
new
Dictionary
<
string
,
State
>();
public
State
curState
=
null
;
public
void
AddNewState
(
State
state
)
{
states
.
Add
(
state
.
name
,
state
);
}
public
void
AddNewStates
(
State
[]
states
)
{
foreach
(
var
state
in
states
)
{
this
.
states
.
Add
(
state
.
name
,
state
);
}
}
public
void
Transtion
(
string
name
)
{
curState
?.
Exit
?.
Invoke
();
curState
=
states
[
name
];
curState
.
Enter
?.
Invoke
();
}
}
public
class
State
{
public
State
(
string
name
)
{
this
.
name
=
name
;
}
public
string
name
;
public
Action
Enter
;
public
Action
Exit
;
public
Action
StateUpdate
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Scripts/StateMachine.cs.meta
0 → 100644
View file @
c184c282
fileFormatVersion: 2
guid: 5578a9700af674045a51dfc453dae843
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Solid.meta
0 → 100644
View file @
c184c282
fileFormatVersion: 2
guid: b3b5f4c3a35455d42bd9430b90675bb6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Solid/Floor.mat
0 → 100644
View file @
c184c282
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!21
&2100000
Material
:
serializedVersion
:
6
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
Floor
m_Shader
:
{
fileID
:
46
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_ShaderKeywords
:
m_LightmapFlags
:
4
m_EnableInstancingVariants
:
0
m_DoubleSidedGI
:
0
m_CustomRenderQueue
:
-1
stringTagMap
:
{}
disabledShaderPasses
:
[]
m_SavedProperties
:
serializedVersion
:
3
m_TexEnvs
:
-
_BumpMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailAlbedoMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailMask
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailNormalMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_EmissionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MainTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MetallicGlossMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_OcclusionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_ParallaxMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
m_Floats
:
-
_BumpScale
:
1
-
_Cutoff
:
0.5
-
_DetailNormalMapScale
:
1
-
_DstBlend
:
0
-
_GlossMapScale
:
1
-
_Glossiness
:
0.5
-
_GlossyReflections
:
1
-
_Metallic
:
0
-
_Mode
:
0
-
_OcclusionStrength
:
1
-
_Parallax
:
0.02
-
_SmoothnessTextureChannel
:
0
-
_SpecularHighlights
:
1
-
_SrcBlend
:
1
-
_UVSec
:
0
-
_ZWrite
:
1
m_Colors
:
-
_Color
:
{
r
:
1
,
g
:
0.64657086
,
b
:
0.3443396
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Solid/Floor.mat.meta
0 → 100644
View file @
c184c282
fileFormatVersion: 2
guid: 66c0dd529e8ced84baf9d6069df25e25
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Solid/Missile.mat
0 → 100644
View file @
c184c282
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!21
&2100000
Material
:
serializedVersion
:
6
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
Missile
m_Shader
:
{
fileID
:
46
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_ShaderKeywords
:
m_LightmapFlags
:
4
m_EnableInstancingVariants
:
0
m_DoubleSidedGI
:
0
m_CustomRenderQueue
:
-1
stringTagMap
:
{}
disabledShaderPasses
:
[]
m_SavedProperties
:
serializedVersion
:
3
m_TexEnvs
:
-
_BumpMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailAlbedoMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailMask
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailNormalMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_EmissionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MainTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MetallicGlossMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_OcclusionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_ParallaxMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
m_Floats
:
-
_BumpScale
:
1
-
_Cutoff
:
0.5
-
_DetailNormalMapScale
:
1
-
_DstBlend
:
0
-
_GlossMapScale
:
1
-
_Glossiness
:
1
-
_GlossyReflections
:
1
-
_Metallic
:
0.272
-
_Mode
:
0
-
_OcclusionStrength
:
1
-
_Parallax
:
0.02
-
_SmoothnessTextureChannel
:
0
-
_SpecularHighlights
:
1
-
_SrcBlend
:
1
-
_UVSec
:
0
-
_ZWrite
:
1
m_Colors
:
-
_Color
:
{
r
:
1
,
g
:
0
,
b
:
0
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Solid/Missile.mat.meta
0 → 100644
View file @
c184c282
fileFormatVersion: 2
guid: 96565613c36fe2545aa8384b0a0c4ab3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Solid/Rock.mat
0 → 100644
View file @
c184c282
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!21
&2100000
Material
:
serializedVersion
:
6
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
Rock
m_Shader
:
{
fileID
:
46
,
guid
:
0000000000000000f000000000000000
,
type
:
0
}
m_ShaderKeywords
:
m_LightmapFlags
:
4
m_EnableInstancingVariants
:
0
m_DoubleSidedGI
:
0
m_CustomRenderQueue
:
-1
stringTagMap
:
{}
disabledShaderPasses
:
[]
m_SavedProperties
:
serializedVersion
:
3
m_TexEnvs
:
-
_BumpMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailAlbedoMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailMask
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_DetailNormalMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_EmissionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MainTex
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_MetallicGlossMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_OcclusionMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
-
_ParallaxMap
:
m_Texture
:
{
fileID
:
0
}
m_Scale
:
{
x
:
1
,
y
:
1
}
m_Offset
:
{
x
:
0
,
y
:
0
}
m_Floats
:
-
_BumpScale
:
1
-
_Cutoff
:
0.5
-
_DetailNormalMapScale
:
1
-
_DstBlend
:
0
-
_GlossMapScale
:
1
-
_Glossiness
:
0.5
-
_GlossyReflections
:
1
-
_Metallic
:
0
-
_Mode
:
0
-
_OcclusionStrength
:
1
-
_Parallax
:
0.02
-
_SmoothnessTextureChannel
:
0
-
_SpecularHighlights
:
1
-
_SrcBlend
:
1
-
_UVSec
:
0
-
_ZWrite
:
1
m_Colors
:
-
_Color
:
{
r
:
0.5377358
,
g
:
0.42270154
,
b
:
0.21560162
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
This diff is collapsed.
Click to expand it.
Grapplers/Assets/Solid/Rock.mat.meta
0 → 100644
View file @
c184c282
fileFormatVersion: 2
guid: b4409bc82ca6b894d96281afa63aa758
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Click to expand it.
Grapplers/ProjectSettings/TagManager.asset
View file @
c184c282
...
...
@@ -3,7 +3,8 @@
---
!u!78
&1
TagManager
:
serializedVersion
:
2
tags
:
[]
tags
:
-
Enemy
layers
:
-
Default
-
TransparentFX
...
...
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