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
2bfab18a
Commit
2bfab18a
authored
Jan 30, 2019
by
15김민규
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
바꾼거 없는데 머지하려고 푸쉬함
parent
21922661
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
82 deletions
+1
-82
testEnemyPattern.unity
Assets/Scenes/testEnemyPattern.unity
+0
-5
MeleeAttack.cs
Assets/Scripts/Characters/Animator State/MeleeAttack.cs
+0
-65
MeleeAttack.cs.meta
Assets/Scripts/Characters/Animator State/MeleeAttack.cs.meta
+0
-11
Enemy.cs
Assets/Scripts/Characters/Enemy.cs
+1
-1
No files found.
Assets/Scenes/testEnemyPattern.unity
View file @
2bfab18a
...
...
@@ -799,11 +799,6 @@ Prefab:
propertyPath
:
m_RootOrder
value
:
11
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
114138317320723260
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
propertyPath
:
attackRange
value
:
2
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
a164c147037e89448820f7387c724c42
,
type
:
2
}
m_IsPrefabAsset
:
0
...
...
Assets/Scripts/Characters/Animator State/MeleeAttack.cs
deleted
100644 → 0
View file @
21922661
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
MeleeAttack
:
StateMachineBehaviour
{
float
timer
;
float
attackDelay
;
float
attackDuration
;
enum
SubState
{
BEFOREATTACK
,
CASTING
,
ATTACKING
}
SubState
subState
;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
override
public
void
OnStateEnter
(
Animator
animator
,
AnimatorStateInfo
stateInfo
,
int
layerIndex
)
{
attackDelay
=
animator
.
GetComponent
<
Enemy
>().
attackDelay
;
attackDuration
=
animator
.
GetComponent
<
Enemy
>().
attackDuration
;
subState
=
SubState
.
BEFOREATTACK
;
timer
=
0.0f
;
}
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
override
public
void
OnStateUpdate
(
Animator
animator
,
AnimatorStateInfo
stateInfo
,
int
layerIndex
)
{
timer
+=
Time
.
deltaTime
;
if
(
timer
<
attackDelay
)
{
if
(
subState
==
SubState
.
BEFOREATTACK
)
{
subState
=
SubState
.
CASTING
;
}
// action during casting attack
}
else
if
(
timer
<
attackDelay
+
attackDuration
)
{
if
(
subState
==
SubState
.
CASTING
)
{
subState
=
SubState
.
ATTACKING
;
animator
.
transform
.
GetChild
(
0
).
GetComponents
<
BoxCollider2D
>()[
0
].
enabled
=
true
;
}
}
else
{
animator
.
SetTrigger
(
"TrackTrigger"
);
}
}
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
override
public
void
OnStateExit
(
Animator
animator
,
AnimatorStateInfo
stateInfo
,
int
layerIndex
)
{
animator
.
transform
.
GetChild
(
0
).
GetComponents
<
BoxCollider2D
>()[
0
].
enabled
=
false
;
}
// OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here
//override public void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
// OnStateIK is called right after Animator.OnAnimatorIK(). Code that sets up animation IK (inverse kinematics) should be implemented here.
//override public void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
//
//}
}
Assets/Scripts/Characters/Animator State/MeleeAttack.cs.meta
deleted
100644 → 0
View file @
21922661
fileFormatVersion: 2
guid: e92be6a4d81dc134fbe2097609bb180b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Characters/Enemy.cs
View file @
2bfab18a
...
...
@@ -57,7 +57,7 @@ public class Enemy : MonoBehaviour {
public
void
GetDamaged
(
float
damage
)
{
currHealth
-=
damage
;
if
(
currHealth
<=
0
)
{
Destroy
(
gameObject
);
gameObject
.
SetActive
(
false
);
return
;
}
float
knockback_dist
=
damage
*
unitDist
/
weight
;
...
...
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