Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ crashlytics-build.properties
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*

# vs / rider config
*.vsconfig
.idea/
6 changes: 0 additions & 6 deletions .vsconfig

This file was deleted.

31 changes: 11 additions & 20 deletions Assets/Enemy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public enum State
public State nextState = State.None;

private bool attackDone = false;
private bool chaseDone = false;
private int curIndex;

public NavMeshAgent navMeshAgent;
public GameObject player;
public GameObject pushVfx;
public GameObject attackedVfx;
public GameObject[] Waypoints;// = new GameObject[6];
public GameObject[] Waypoints;

private float dist;

private void Start()
{
Expand All @@ -55,7 +55,8 @@ private void Start()

private void Update()
{

dist = Vector3.Distance(player.transform.position, this.transform.position);

//1. 스테이트 전환 상황 판단
if (nextState == State.None)
{
Expand All @@ -64,16 +65,9 @@ private void Update()
case State.Idle:
this.GetComponent<Rigidbody>().velocity = new Vector3(0, 0, 0);
nextState = State.Walk;
//1 << 6인 이유는 Player의 Layer가 6이기 때문
/*if (Physics.CheckSphere(transform.position, chaseRange, 1 << 6, QueryTriggerInteraction.Ignore))
{
nextState = State.Chase;
}*/
break;
case State.Walk:
//this.GetComponent<Rigidbody>().velocity = new Vector3(0, 0, 0);
//1 << 6인 이유는 Player의 Layer가 6이기 때문
if (Physics.CheckSphere(transform.position, chaseRange, 1 << 6, QueryTriggerInteraction.Ignore))
if (dist < chaseRange)
{
nextState = State.Chase;
}
Expand All @@ -85,7 +79,8 @@ private void Update()

break;
case State.Attack:
if (attackDone && !Physics.CheckSphere(transform.position, attackRange, 1 << 6, QueryTriggerInteraction.Ignore))
Debug.Log("attack");
if (attackDone && dist > attackRange)
{
nextState = State.Chase;
attackDone = false;
Expand All @@ -96,12 +91,13 @@ private void Update()
}
break;
case State.Chase:
Debug.Log("chase");
navMeshAgent.SetDestination(player.transform.position);
if (Physics.CheckSphere(transform.position, attackRange, 1 << 6, QueryTriggerInteraction.Ignore))
if (dist < attackRange)
{
nextState = State.Attack;
}
else if (!Physics.CheckSphere(transform.position, chaseRange, 1 << 6, QueryTriggerInteraction.Ignore))
else if (dist > chaseRange)
{
nextState = State.Walk;
navMeshAgent.SetDestination(Waypoints[curIndex].transform.position);
Expand Down Expand Up @@ -162,13 +158,8 @@ private void Update()

private void Attack() //현재 공격은 애니메이션만 작동합니다.
{
//attackedVfx.SetActive(true);
//attackedVfx.transform.position = player.transform.position;
attackDone = true;

player.GetComponent<MoveControl>().playerHp--;


}


Expand Down Expand Up @@ -199,7 +190,7 @@ public void PushSkill()

Vector3 direction = this.transform.position - player.transform.position;
direction = direction.normalized;
this.GetComponent<Rigidbody>().AddForce(direction * 1800, ForceMode.Impulse);
this.GetComponent<Rigidbody>().AddForce(direction * 3000, ForceMode.Impulse);

GameObject vfx = Instantiate(pushVfx) as GameObject;
vfx.transform.position = this.transform.position;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: NAT_GroundMoss
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
- _NORMALMAP
m_InvalidKeywords: []
m_InvalidKeywords:
- _EDGEFADING_ON
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
Expand All @@ -30,6 +32,10 @@ Material:
m_Texture: {fileID: 2800000, guid: 504c6e0b6a68a1141aeb5b2328db2a42, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorRamp:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 30, y: 30}
Expand Down Expand Up @@ -85,26 +91,36 @@ Material:
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _ColorMultiply: 2
- _ColorRampOffset: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 0.4
- _DstBlend: 0
- _DstBlendMode: 4
- _EdgeFading: 1
- _EmissionScaleUI: 0
- _EnvironmentReflections: 1
- _FadingFalloff: 0.05
- _Falloff: 4
- _GlossMapScale: 1
- _Glossiness: 0.04
- _GlossyReflections: 1
- _Intensity: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Power: 15
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Scale: 0.055
- _Smoothness: 0.04
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendMode: 0
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
Expand All @@ -114,6 +130,9 @@ Material:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1}
- _KeyboardPosition: {r: 0, g: 0, b: 0, a: 0}
- _KeyboardRotation: {r: 0, g: 0, b: 0, a: 0}
- _KeyboardScale: {r: 1, g: 1, b: 1, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &3927239593630766239
Expand Down
15 changes: 8 additions & 7 deletions Assets/External Assets/Castle Environment/Materials/bark_2_d.mat
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: bark_2_d
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
- _METALLICGLOSSMAP
- _METALLICSPECGLOSSMAP
- _NORMALMAP
- _OCCLUSIONMAP
- _PARALLAXMAP
m_InvalidKeywords:
- _METALLICSPECGLOSSMAP
- _OCCLUSIONMAP
- _METALLICGLOSSMAP
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
Expand Down Expand Up @@ -126,8 +127,8 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.42647055, g: 0.42638403, b: 0.42333475, a: 1}
- _Color: {r: 0.42647052, g: 0.426384, b: 0.42333472, a: 1}
- _BaseColor: {r: 0.42647046, g: 0.42638397, b: 0.4233347, a: 1}
- _Color: {r: 0.42647043, g: 0.42638394, b: 0.42333466, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
15 changes: 8 additions & 7 deletions Assets/External Assets/Castle Environment/Materials/canvas_d.mat
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: canvas_d
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
- _METALLICGLOSSMAP
- _NORMALMAP
m_InvalidKeywords:
- _METALLICSPECGLOSSMAP
- _NORMALMAP
- _OCCLUSIONMAP
m_InvalidKeywords:
- _METALLICGLOSSMAP
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
Expand Down Expand Up @@ -125,8 +126,8 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.72794116, g: 0.27626324, b: 0.23551035, a: 1}
- _Color: {r: 0.72794116, g: 0.2762632, b: 0.23551032, a: 1}
- _BaseColor: {r: 0.72794116, g: 0.27626318, b: 0.23551029, a: 1}
- _Color: {r: 0.72794116, g: 0.27626315, b: 0.23551026, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: cobblestone_wall_1_fixed_d
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
- _METALLICGLOSSMAP
- _NORMALMAP
m_InvalidKeywords:
- _METALLICSPECGLOSSMAP
- _NORMALMAP
- _OCCLUSIONMAP
m_InvalidKeywords:
- _METALLICGLOSSMAP
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: dark_iron
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
- _METALLICGLOSSMAP
- _NORMALMAP
m_InvalidKeywords:
- _METALLICSPECGLOSSMAP
- _NORMALMAP
- _OCCLUSIONMAP
m_InvalidKeywords:
- _METALLICGLOSSMAP
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
Expand Down Expand Up @@ -112,8 +113,8 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.2941176, g: 0.2941176, b: 0.2941176, a: 1}
- _Color: {r: 0.29411757, g: 0.29411757, b: 0.29411757, a: 1}
- _BaseColor: {r: 0.29411754, g: 0.29411754, b: 0.29411754, a: 1}
- _Color: {r: 0.2941175, g: 0.2941175, b: 0.2941175, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: dark_wood
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
- _METALLICGLOSSMAP
- _NORMALMAP
m_InvalidKeywords:
- _METALLICSPECGLOSSMAP
- _NORMALMAP
- _OCCLUSIONMAP
m_InvalidKeywords:
- _METALLICGLOSSMAP
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
Expand Down Expand Up @@ -112,8 +113,8 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.1838235, g: 0.1838235, b: 0.1838235, a: 1}
- _Color: {r: 0.18382347, g: 0.18382347, b: 0.18382347, a: 1}
- _BaseColor: {r: 0.18382344, g: 0.18382344, b: 0.18382344, a: 1}
- _Color: {r: 0.1838234, g: 0.1838234, b: 0.1838234, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: fabric_bag_2_d
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords:
- _EMISSION
- _METALLICGLOSSMAP
- _NORMALMAP
m_InvalidKeywords:
- _METALLICSPECGLOSSMAP
- _NORMALMAP
- _OCCLUSIONMAP
m_InvalidKeywords:
- _METALLICGLOSSMAP
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
Expand Down
Loading