diff --git a/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/BlueDragon/BlueDragon Animation Controller.controller b/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/BlueDragon/BlueDragon Animation Controller.controller index a919b7dd..253e2713 100644 --- a/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/BlueDragon/BlueDragon Animation Controller.controller +++ b/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/BlueDragon/BlueDragon Animation Controller.controller @@ -261,7 +261,7 @@ AnimatorStateTransition: m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 + m_CanTransitionToSelf: 0 --- !u!1102 &8693684011770968853 AnimatorState: serializedVersion: 6 diff --git a/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/Monster Animation Controller.controller b/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/Monster Animation Controller.controller index f831d52f..dde871fd 100644 --- a/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/Monster Animation Controller.controller +++ b/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/Monster Animation Controller.controller @@ -41,7 +41,7 @@ AnimatorState: m_StateMachineBehaviours: [] m_Position: {x: 50, y: 50, z: 0} m_IKOnFeet: 0 - m_WriteDefaultValues: 1 + m_WriteDefaultValues: 0 m_Mirror: 0 m_SpeedParameterActive: 0 m_MirrorParameterActive: 0 @@ -239,7 +239,7 @@ AnimatorStateTransition: m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 + m_CanTransitionToSelf: 0 --- !u!1102 &8693684011770968853 AnimatorState: serializedVersion: 6 diff --git a/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/RedDragon/Attack.anim b/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/RedDragon/Attack.anim index 41b9096a..2bb39f58 100644 --- a/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/RedDragon/Attack.anim +++ b/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/RedDragon/Attack.anim @@ -77,7 +77,7 @@ AnimationClip: outWeight: 0 - serializedVersion: 3 time: 0.5 - value: 4.267051e-22 + value: 3.3254636e-12 inSlope: Infinity outSlope: Infinity tangentMode: 103 @@ -191,7 +191,7 @@ AnimationClip: outWeight: 0 - serializedVersion: 3 time: 0.5 - value: 4.267051e-22 + value: 3.3254636e-12 inSlope: Infinity outSlope: Infinity tangentMode: 103 diff --git a/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/RedDragon/RedDragon Animator Controller.controller b/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/RedDragon/RedDragon Animator Controller.controller index fc111985..3902e141 100644 --- a/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/RedDragon/RedDragon Animator Controller.controller +++ b/Gameton-06/Assets/Gameton/Resources/Animation/Monster/Dragon/RedDragon/RedDragon Animator Controller.controller @@ -243,4 +243,4 @@ AnimatorStateTransition: m_HasFixedDuration: 1 m_InterruptionSource: 0 m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 + m_CanTransitionToSelf: 0 diff --git a/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity b/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity index 700dd72f..8b10dd73 100644 --- a/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity +++ b/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity @@ -13507,8 +13507,9 @@ GameObject: m_Component: - component: {fileID: 336376026} - component: {fileID: 336376025} + - component: {fileID: 336376027} m_Layer: 3 - m_Name: Collider + m_Name: Eyesight m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -13543,12 +13544,12 @@ CircleCollider2D: m_CallbackLayers: serializedVersion: 2 m_Bits: 4294967295 - m_IsTrigger: 0 + m_IsTrigger: 1 m_UsedByEffector: 0 m_UsedByComposite: 0 m_Offset: {x: 0, y: 0} serializedVersion: 2 - m_Radius: 0.5 + m_Radius: 1 --- !u!4 &336376026 Transform: m_ObjectHideFlags: 0 @@ -13564,6 +13565,19 @@ Transform: m_Children: [] m_Father: {fileID: 585265470} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &336376027 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 336376024} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0eeefb865ea9d4749bbb4de3d1100f3e, type: 3} + m_Name: + m_EditorClassIdentifier: + _monsterBase: {fileID: 585265463} --- !u!213 &345793892 Sprite: m_ObjectHideFlags: 0 @@ -22518,6 +22532,7 @@ Transform: m_Children: - {fileID: 1574532559} - {fileID: 336376026} + - {fileID: 2003670963} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &589876486 @@ -71855,6 +71870,87 @@ Sprite: m_PhysicsShape: [] m_Bones: [] m_SpriteID: +--- !u!1 &2003670962 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2003670963} + - component: {fileID: 2003670964} + - component: {fileID: 2003670965} + m_Layer: 3 + m_Name: AttackRange + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2003670963 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2003670962} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 9, y: 1, z: 11} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 585265470} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!58 &2003670964 +CircleCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2003670962} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_ForceSendLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ForceReceiveLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_ContactCaptureLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_CallbackLayers: + serializedVersion: 2 + m_Bits: 4294967295 + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + serializedVersion: 2 + m_Radius: 0.5 +--- !u!114 &2003670965 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2003670962} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0913d8f50c531ce4585705c1366b8351, type: 3} + m_Name: + m_EditorClassIdentifier: + _monsterBase: {fileID: 585265463} --- !u!213 &2010724901 Sprite: m_ObjectHideFlags: 0 diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/Attack.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/Attack.cs new file mode 100644 index 00000000..271f48d2 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/Attack.cs @@ -0,0 +1,20 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace TON +{ + public class Attack : MonoBehaviour + { + [SerializeField] + private MonsterBase _monsterBase; + + private void OnTriggerEnter2D(Collider2D other) + { + if (other.CompareTag("Player")) + { + _monsterBase.Attack(other.gameObject); + } + } + } +} diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/Attack.cs.meta b/Gameton-06/Assets/Gameton/Scripts/Monster/Attack.cs.meta new file mode 100644 index 00000000..46009945 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/Attack.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0913d8f50c531ce4585705c1366b8351 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/Eyesight.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/Eyesight.cs new file mode 100644 index 00000000..f7761782 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/Eyesight.cs @@ -0,0 +1,50 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace TON +{ + public class Eyesight : MonoBehaviour + { + [SerializeField] + private MonsterBase _monsterBase; + // private bool _isDetect; + + + private void OnTriggerEnter2D(Collider2D other) + { + if (other.CompareTag("Player")) + { + // TODO : 플레이어 감지하면 따라가기 + + _monsterBase.IsDetect = true; + Debug.Log("감지됨"); + + if (_monsterBase.IsDetect) + { + _monsterBase.Detect(other.gameObject); + + // _monsterBase.IsWalking = false; + } + } + } + + // 단순 플레이어 태그 기준 따라가는 코드 + private void FixedUpdate() + { + // 타겟의 위치에서 내 현제 위치를 뺌 + // UnityEngine.Vector2 direction = target.transform.position - transform.position; + + // 방향 * 속도 * 시간간격 + // transform.Translate(direction.normalized * speed * Time.deltaTime); + // animator.SetBool("Iidle", true); + + } + + private void OnTriggerExit2D(Collider2D other) + { + _monsterBase.IsDetect = false; + _monsterBase.IsWalking = true; + } + } +} diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/Eyesight.cs.meta b/Gameton-06/Assets/Gameton/Scripts/Monster/Eyesight.cs.meta new file mode 100644 index 00000000..eab48d4b --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/Eyesight.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0eeefb865ea9d4749bbb4de3d1100f3e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: