Commit e49471bd authored by 15김민규's avatar 15김민규

몬스터 하향. 생명석 등장은 확인. 튀어나오는거랑 아이템 나오는거 안됨

parent c4245b9f
...@@ -29,16 +29,7 @@ AnimationClip: ...@@ -29,16 +29,7 @@ AnimationClip:
inWeight: 0 inWeight: 0
outWeight: 0 outWeight: 0
- serializedVersion: 3 - serializedVersion: 3
time: 0.083333336 time: 1.0166667
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.18333334
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
...@@ -47,16 +38,7 @@ AnimationClip: ...@@ -47,16 +38,7 @@ AnimationClip:
inWeight: 0 inWeight: 0
outWeight: 0 outWeight: 0
- serializedVersion: 3 - serializedVersion: 3
time: 0.8333333 time: 1.4833333
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.9
value: 0 value: 0
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
...@@ -75,15 +57,15 @@ AnimationClip: ...@@ -75,15 +57,15 @@ AnimationClip:
- curve: - curve:
- time: 0 - time: 0
value: {fileID: 21300000, guid: b0d499510f5dd4144bc2b110a4fba53c, type: 3} value: {fileID: 21300000, guid: b0d499510f5dd4144bc2b110a4fba53c, type: 3}
- time: 0.016666668 - time: 0.18333334
value: {fileID: 21300000, guid: 37e5cfde8d3541845a184c4d6ab25e21, type: 3} value: {fileID: 21300000, guid: 37e5cfde8d3541845a184c4d6ab25e21, type: 3}
- time: 0.083333336 - time: 0.41666666
value: {fileID: 21300000, guid: 2806c6904b006114bad1fb3f64d64c14, type: 3} value: {fileID: 21300000, guid: 2806c6904b006114bad1fb3f64d64c14, type: 3}
- time: 0.18333334 - time: 1.0166667
value: {fileID: 21300000, guid: 6234b3bf70d0272478b444abdd572f09, type: 3} value: {fileID: 21300000, guid: 6234b3bf70d0272478b444abdd572f09, type: 3}
- time: 0.25 - time: 1.2666667
value: {fileID: 21300000, guid: f7d12f4a971df594c8d297610a3f9e57, type: 3} value: {fileID: 21300000, guid: f7d12f4a971df594c8d297610a3f9e57, type: 3}
- time: 0.8333333 - time: 1.4833333
value: {fileID: 21300000, guid: b2382ef0803ec1c4c811783916c7aa49, type: 3} value: {fileID: 21300000, guid: b2382ef0803ec1c4c811783916c7aa49, type: 3}
attribute: m_Sprite attribute: m_Sprite
path: path:
...@@ -122,7 +104,7 @@ AnimationClip: ...@@ -122,7 +104,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0 m_AdditiveReferencePoseTime: 0
m_StartTime: 0 m_StartTime: 0
m_StopTime: 0.9 m_StopTime: 1.5
m_OrientationOffsetY: 0 m_OrientationOffsetY: 0
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0
...@@ -151,16 +133,7 @@ AnimationClip: ...@@ -151,16 +133,7 @@ AnimationClip:
inWeight: 0 inWeight: 0
outWeight: 0 outWeight: 0
- serializedVersion: 3 - serializedVersion: 3
time: 0.083333336 time: 1.0166667
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.18333334
value: 1 value: 1
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
...@@ -169,16 +142,7 @@ AnimationClip: ...@@ -169,16 +142,7 @@ AnimationClip:
inWeight: 0 inWeight: 0
outWeight: 0 outWeight: 0
- serializedVersion: 3 - serializedVersion: 3
time: 0.8333333 time: 1.4833333
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.9
value: 0 value: 0
inSlope: Infinity inSlope: Infinity
outSlope: Infinity outSlope: Infinity
......
...@@ -13,31 +13,31 @@ AnimatorController: ...@@ -13,31 +13,31 @@ AnimatorController:
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 0}
- m_Name: AttackTrigger - m_Name: AttackTrigger
m_Type: 9 m_Type: 9
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 0}
- m_Name: DamagedTrigger - m_Name: DamagedTrigger
m_Type: 9 m_Type: 9
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 0}
- m_Name: DeadTrigger - m_Name: DeadTrigger
m_Type: 9 m_Type: 9
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 0}
- m_Name: knockbackDistance - m_Name: knockbackDistance
m_Type: 1 m_Type: 1
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 0}
m_AnimatorLayers: m_AnimatorLayers:
- serializedVersion: 5 - serializedVersion: 5
m_Name: Base Layer m_Name: Base Layer
...@@ -156,11 +156,11 @@ AnimatorStateTransition: ...@@ -156,11 +156,11 @@ AnimatorStateTransition:
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0.75 m_ExitTime: 0.75
m_HasExitTime: 0 m_HasExitTime: 0
m_HasFixedDuration: 1 m_HasFixedDuration: 0
m_InterruptionSource: 0 m_InterruptionSource: 0
m_OrderedInterruption: 1 m_OrderedInterruption: 1
m_CanTransitionToSelf: 1 m_CanTransitionToSelf: 1
...@@ -246,8 +246,7 @@ AnimatorState: ...@@ -246,8 +246,7 @@ AnimatorState:
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: [] m_Transitions: []
m_StateMachineBehaviours: m_StateMachineBehaviours: []
- {fileID: 114273311953884252}
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
m_WriteDefaultValues: 1 m_WriteDefaultValues: 1
...@@ -315,7 +314,7 @@ AnimatorState: ...@@ -315,7 +314,7 @@ AnimatorState:
m_SpeedParameter: m_SpeedParameter:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter: knockbackDistance
--- !u!1102 &1102828359910447394 --- !u!1102 &1102828359910447394
AnimatorState: AnimatorState:
serializedVersion: 5 serializedVersion: 5
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
고대유적,1230,새끼 박쥐,5,4,0,0,0,0,0,0,1,0,0,0,2,0,0,0 고대유적,1230,새끼 박쥐,5,4,0,0,0,0,0,0,1,0,0,0,2,0,0,0
고대유적,115,엘리게이터-1,1,4,6,3,1,0,2,0,5,5,3,1,3,1,1,0 고대유적,115,엘리게이터-1,1,4,6,3,1,0,2,0,5,5,3,1,3,1,1,0
고대유적,116,엘리게이터-2,1,4,6,3,1,0,2,0,5,5,3,1,3,1,1,0 고대유적,116,엘리게이터-2,1,4,6,3,1,0,2,0,5,5,3,1,3,1,1,0
고대유적,117,테스트용데이터-0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0 고대유적,117,테스트용데이터,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0
고대유적,,,,,,,,,,,,,,,,,, 고대유적,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,
......
...@@ -267,10 +267,8 @@ MonoBehaviour: ...@@ -267,10 +267,8 @@ MonoBehaviour:
attackRange: 1 attackRange: 1
patrolSpeed: 2.5 patrolSpeed: 2.5
trackSpeed: 3.5 trackSpeed: 3.5
currHealth: 0
playerDistance: 0 playerDistance: 0
inventoryManager: {fileID: 0} untouchable: 0
dropTable:
--- !u!114 &114173716467154830 --- !u!114 &114173716467154830
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
......
...@@ -1330,7 +1330,7 @@ Prefab: ...@@ -1330,7 +1330,7 @@ Prefab:
- target: {fileID: 224363839195006936, guid: e6794ab8e2e4c6340a23b382e9497cbb, - target: {fileID: 224363839195006936, guid: e6794ab8e2e4c6340a23b382e9497cbb,
type: 2} type: 2}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 10 value: 9
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 224667404527337120, guid: e6794ab8e2e4c6340a23b382e9497cbb, - target: {fileID: 224667404527337120, guid: e6794ab8e2e4c6340a23b382e9497cbb,
type: 2} type: 2}
...@@ -1340,7 +1340,7 @@ Prefab: ...@@ -1340,7 +1340,7 @@ Prefab:
- target: {fileID: 224036569745634590, guid: e6794ab8e2e4c6340a23b382e9497cbb, - target: {fileID: 224036569745634590, guid: e6794ab8e2e4c6340a23b382e9497cbb,
type: 2} type: 2}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 9 value: 10
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e6794ab8e2e4c6340a23b382e9497cbb, type: 2} m_SourcePrefab: {fileID: 100100000, guid: e6794ab8e2e4c6340a23b382e9497cbb, type: 2}
......
...@@ -11,7 +11,7 @@ public class AttackProperty : MonoBehaviour{ ...@@ -11,7 +11,7 @@ public class AttackProperty : MonoBehaviour{
private void OnTriggerEnter2D(Collider2D collision) private void OnTriggerEnter2D(Collider2D collision)
{ {
if (collision.CompareTag("Enemy")) if (collision.CompareTag("Enemy") && !collision.transform.GetChild(0).GetComponent<Enemy>().untouchable)
{ {
Debug.Log(damage); Debug.Log(damage);
PlayerAttackInfo curAttack = new PlayerAttackInfo(damage, knockBackMultiplier, debuffNum, debuffType, debuffTime); PlayerAttackInfo curAttack = new PlayerAttackInfo(damage, knockBackMultiplier, debuffNum, debuffType, debuffTime);
......
fileFormatVersion: 2
guid: 1c83a3604eb824f429133d749b5f7544
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class MeleeIdle : StateMachineBehaviour { public class EnemyMeleeIdle : StateMachineBehaviour {
Vector2 origin; Vector2 origin;
float patrolRange; float patrolRange;
float patrolSpeed; float patrolSpeed;
float noticeRange; float noticeRange;
GameObject player;
Vector3 leftsideAngle = new Vector3(0, 0, 0); Vector3 leftsideAngle = new Vector3(0, 0, 0);
Vector3 rightsideAngle = new Vector3(0, 180, 0); Vector3 rightsideAngle = new Vector3(0, 180, 0);
Transform animatorRoot; Transform animatorRoot;
...@@ -20,7 +19,6 @@ public class MeleeIdle : StateMachineBehaviour { ...@@ -20,7 +19,6 @@ public class MeleeIdle : StateMachineBehaviour {
patrolRange = animator.GetComponent<Enemy>().patrolRange; patrolRange = animator.GetComponent<Enemy>().patrolRange;
noticeRange = animator.GetComponent<Enemy>().noticeRange; noticeRange = animator.GetComponent<Enemy>().noticeRange;
patrolSpeed = animator.GetComponent<Enemy>().patrolSpeed; patrolSpeed = animator.GetComponent<Enemy>().patrolSpeed;
player = EnemyManager.Instance.player;
animatorRoot = animator.transform.parent; animatorRoot = animator.transform.parent;
} }
......
...@@ -2,17 +2,15 @@ ...@@ -2,17 +2,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class MeleeTrack : StateMachineBehaviour { public class EnemyMeleeTrack : StateMachineBehaviour {
GameObject player; GameObject player;
float trackSpeed; float trackSpeed;
float attackRange; float attackRange;
Vector3 leftsideAngle = new Vector3(0, 0, 0); Vector3 leftsideAngle = new Vector3(0, 0, 0);
Vector3 rightsideAngle = new Vector3(0, 180, 0); Vector3 rightsideAngle = new Vector3(0, 180, 0);
readonly float dirChangeTime = 0.5f;
Transform pivotTransform; Transform pivotTransform;
readonly int maxFrame = 10; readonly int maxFrame = 10;
int frameCounter; int frameCounter;
Vector2 centerOfBody;
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state // 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) { override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
...@@ -23,23 +21,22 @@ public class MeleeTrack : StateMachineBehaviour { ...@@ -23,23 +21,22 @@ public class MeleeTrack : StateMachineBehaviour {
pivotTransform = animator.transform.parent; pivotTransform = animator.transform.parent;
float halfHeight = pivotTransform.gameObject.GetComponent<BoxCollider2D>().size.y / 2.0f; float halfHeight = pivotTransform.gameObject.GetComponent<BoxCollider2D>().size.y / 2.0f;
Vector2 rootPosition2D = pivotTransform.position; Vector2 rootPosition2D = pivotTransform.position;
centerOfBody = new Vector2(0, halfHeight) + rootPosition2D;
frameCounter = 0; frameCounter = 0;
} }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
if (animator.GetComponent<Enemy>().playerDistance < attackRange)
{
animator.SetTrigger("AttackTrigger");
return;
}
frameCounter += 1; frameCounter += 1;
if (frameCounter >= maxFrame) if (frameCounter >= maxFrame)
{ {
pivotTransform.eulerAngles = (player.transform.position.x - pivotTransform.position.x < 0) ? leftsideAngle : rightsideAngle; pivotTransform.eulerAngles = (player.transform.position.x - pivotTransform.position.x < 0) ? leftsideAngle : rightsideAngle;
frameCounter = 0; frameCounter = 0;
} }
if (animator.GetComponent<Enemy>().playerDistance < attackRange)
{
animator.SetTrigger("AttackTrigger");
return;
}
Vector2 currPosition = pivotTransform.position; Vector2 currPosition = pivotTransform.position;
Vector2 movingDistance = pivotTransform.right * trackSpeed * Time.deltaTime * -1; Vector2 movingDistance = pivotTransform.right * trackSpeed * Time.deltaTime * -1;
......
...@@ -6,8 +6,6 @@ using UnityEngine; ...@@ -6,8 +6,6 @@ using UnityEngine;
public class Enemy : MonoBehaviour { public class Enemy : MonoBehaviour {
// data // data
// static
static readonly float unitDist = 3;
// debuff // debuff
float[] immunity_time = new float[5] { 0.0f, 3.0f, 6.0f, 6.0f, 6.0f };//면역 시간 float[] immunity_time = new float[5] { 0.0f, 3.0f, 6.0f, 6.0f, 6.0f };//면역 시간
...@@ -40,6 +38,7 @@ public class Enemy : MonoBehaviour { ...@@ -40,6 +38,7 @@ public class Enemy : MonoBehaviour {
[HideInInspector] [HideInInspector]
public float playerDistance; public float playerDistance;
private Animator animator; private Animator animator;
public bool untouchable = false;
// drop item // drop item
private int[] dropTable; private int[] dropTable;
...@@ -71,6 +70,7 @@ public class Enemy : MonoBehaviour { ...@@ -71,6 +70,7 @@ public class Enemy : MonoBehaviour {
currHealth -= attack.damage; currHealth -= attack.damage;
if (currHealth <= 0) if (currHealth <= 0)
{ {
untouchable = true;
animator.SetTrigger("DeadTrigger"); animator.SetTrigger("DeadTrigger");
return; return;
} }
...@@ -87,7 +87,6 @@ public class Enemy : MonoBehaviour { ...@@ -87,7 +87,6 @@ public class Enemy : MonoBehaviour {
// Drop 아이템 결정. 인덱스 별 아이템은 맨 밑에 서술 // Drop 아이템 결정. 인덱스 별 아이템은 맨 밑에 서술
float denominator = dropTable[dropTable.Length - 1]; float denominator = dropTable[dropTable.Length - 1];
float numerator = Random.Range(0, denominator); float numerator = Random.Range(0, denominator);
int indexOfItem = 0; int indexOfItem = 0;
for (int i = 0; i < dropTable.Length; i++) for (int i = 0; i < dropTable.Length; i++)
{ {
...@@ -102,12 +101,12 @@ public class Enemy : MonoBehaviour { ...@@ -102,12 +101,12 @@ public class Enemy : MonoBehaviour {
if (indexOfItem >= 1 && indexOfItem <= 5) // Lifestone if (indexOfItem >= 1 && indexOfItem <= 5) // Lifestone
{ {
// insert! lifeStoneManager.InstantiateDroppedLifeStone(
indexOfItem, EnemyManager.goldPer, EnemyManager.ameNum, transform.parent.position, EnemyManager.dropObjStrength);
} }
if (indexOfItem == 6) // Gold Potion if (indexOfItem == 6) // Gold Potion
{ {
Debug.Log("Gold Potion"); lifeStoneManager.InstantiatePotion(transform.parent.position, EnemyManager.dropObjStrength);
// insert!
} }
if (indexOfItem == 7) // Amethyst Potion if (indexOfItem == 7) // Amethyst Potion
{ {
...@@ -116,21 +115,21 @@ public class Enemy : MonoBehaviour { ...@@ -116,21 +115,21 @@ public class Enemy : MonoBehaviour {
} }
if (indexOfItem >= 8 && indexOfItem <= 11) // Item if (indexOfItem >= 8 && indexOfItem <= 11) // Item
{ {
inventoryManager.ItemInstantiate((ItemQuality)(indexOfItem - 8), transform.parent.position); Debug.Log("Item");
inventoryManager.ItemInstantiate((ItemQuality)(indexOfItem - 8), transform.parent.position, EnemyManager.dropObjStrength);
} }
if (indexOfItem >= 12 && indexOfItem <= 15) // Addon if (indexOfItem >= 12 && indexOfItem <= 15) // Addon
{ {
inventoryManager.AddonInstantiate((ItemQuality)(indexOfItem - 12), transform.parent.position); inventoryManager.AddonInstantiate((ItemQuality)(indexOfItem - 12), transform.parent.position);
} }
// Pool로 돌아가기 전 Enemy의 상태를 초기화
this.currHealth = this.maxHealth; this.currHealth = this.maxHealth;
this.untouchable = false;
return; return;
} }
// Coroutine // Coroutine
// Debuff
IEnumerator DebuffCase(EnemyDebuffed sCase) IEnumerator DebuffCase(EnemyDebuffed sCase)
{ {
......
...@@ -9,7 +9,11 @@ public class EnemyManager : Singleton<EnemyManager> ...@@ -9,7 +9,11 @@ public class EnemyManager : Singleton<EnemyManager>
{ {
// data // data
// static // static
private static readonly int poolSize = 10; private readonly int poolSize = 10;
public static readonly float goldPer = 0.5f;
public static readonly int ameNum = 0;
public static readonly float dropObjStrength = 1f;
// hold player for animation // hold player for animation
public GameObject player; public GameObject player;
......
...@@ -52,4 +52,4 @@ Physics2DSettings: ...@@ -52,4 +52,4 @@ Physics2DSettings:
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
m_LayerCollisionMatrix: ffdffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9fffffffdffffffffffffffefffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_LayerCollisionMatrix: ffdffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe9ffeffffdffffffffffffffedffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment