Commit 15b42613 authored by JT-ASUS-ROG\JT's avatar JT-ASUS-ROG\JT
Browse files

fixed merge conflicts hopefully

parents 2adb9cb2 269735bf
......@@ -63,7 +63,18 @@ TextureImporter:
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
......
......@@ -63,7 +63,18 @@ TextureImporter:
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
......
......@@ -113,6 +113,64 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &22080637
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4992245467555260, guid: ebf39984a96111644b2e1ab0058e6000, type: 2}
propertyPath: m_LocalPosition.x
value: -6.99
objectReference: {fileID: 0}
- target: {fileID: 4992245467555260, guid: ebf39984a96111644b2e1ab0058e6000, type: 2}
propertyPath: m_LocalPosition.y
value: -5.41
objectReference: {fileID: 0}
- target: {fileID: 4992245467555260, guid: ebf39984a96111644b2e1ab0058e6000, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4992245467555260, guid: ebf39984a96111644b2e1ab0058e6000, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4992245467555260, guid: ebf39984a96111644b2e1ab0058e6000, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4992245467555260, guid: ebf39984a96111644b2e1ab0058e6000, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4992245467555260, guid: ebf39984a96111644b2e1ab0058e6000, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4992245467555260, guid: ebf39984a96111644b2e1ab0058e6000, type: 2}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 61695175158462730, guid: ebf39984a96111644b2e1ab0058e6000,
type: 2}
propertyPath: m_Offset.x
value: 1.1644957
objectReference: {fileID: 0}
- target: {fileID: 61695175158462730, guid: ebf39984a96111644b2e1ab0058e6000,
type: 2}
propertyPath: m_Size.x
value: 3.5710082
objectReference: {fileID: 0}
- target: {fileID: 114830362039822046, guid: ebf39984a96111644b2e1ab0058e6000,
type: 2}
propertyPath: enemyStats
value:
objectReference: {fileID: 11400000, guid: e888c02191f13d34e81a5acaac0937fd,
type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ebf39984a96111644b2e1ab0058e6000, type: 2}
m_IsPrefabAsset: 0
--- !u!1001 &34497507
Prefab:
m_ObjectHideFlags: 0
......@@ -122,7 +180,7 @@ Prefab:
m_Modifications:
- target: {fileID: 4428255577052944, guid: 0e932f5bf5f75fb4c829814e64a68d5b, type: 2}
propertyPath: m_LocalPosition.x
value: -10.52
value: -10.42
objectReference: {fileID: 0}
- target: {fileID: 4428255577052944, guid: 0e932f5bf5f75fb4c829814e64a68d5b, type: 2}
propertyPath: m_LocalPosition.y
......@@ -150,7 +208,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 4428255577052944, guid: 0e932f5bf5f75fb4c829814e64a68d5b, type: 2}
propertyPath: m_RootOrder
value: 4
value: 3
objectReference: {fileID: 0}
- target: {fileID: 4428255577052944, guid: 0e932f5bf5f75fb4c829814e64a68d5b, type: 2}
propertyPath: m_LocalScale.x
......@@ -163,23 +221,58 @@ Prefab:
- target: {fileID: 61260635011814096, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: m_Size.x
value: 0.14
value: 0.5675497
objectReference: {fileID: 0}
- target: {fileID: 61260635011814096, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: m_Size.y
value: 0.33
value: 1.8373909
objectReference: {fileID: 0}
- target: {fileID: 50909167903787148, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: m_BodyType
value: 2
value: 0
objectReference: {fileID: 0}
- target: {fileID: 212882685907438360, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: m_FlipX
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114093662859574892, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 61260635011814096, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: m_Offset.y
value: -0.041110516
objectReference: {fileID: 0}
- target: {fileID: 61260635011814096, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: m_Offset.x
value: -0.02740717
objectReference: {fileID: 0}
- target: {fileID: 114160266301343776, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: moveSpeed
value: 7.03
objectReference: {fileID: 0}
- target: {fileID: 114160266301343776, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: jumpSpeed
value: 4.21
objectReference: {fileID: 0}
- target: {fileID: 114160266301343776, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: airSpeed
value: 1.58
objectReference: {fileID: 0}
- target: {fileID: 114160266301343776, guid: 0e932f5bf5f75fb4c829814e64a68d5b,
type: 2}
propertyPath: slowFactor
value: 1.04
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0e932f5bf5f75fb4c829814e64a68d5b, type: 2}
m_IsPrefabAsset: 0
......@@ -259,7 +352,7 @@ GameObject:
- component: {fileID: 664022979}
- component: {fileID: 664022978}
- component: {fileID: 664022977}
m_Layer: 0
m_Layer: 10
m_Name: tempTerrain
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -348,144 +441,8 @@ Transform:
m_LocalScale: {x: 26.334301, y: 1.2862412, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &830689612
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 830689616}
- component: {fileID: 830689615}
- component: {fileID: 830689614}
- component: {fileID: 830689613}
- component: {fileID: 830689617}
m_Layer: 0
m_Name: tempAI
m_TagString: Priest
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &830689613
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 830689612}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ce7a5641708bbb74ebdbef1a0bd56644, type: 3}
m_Name:
m_EditorClassIdentifier:
currentState: {fileID: 11400000, guid: a816046eec1537b41a57d3078ba94d9c, type: 2}
remainState: {fileID: 11400000, guid: 7759a25a0ac632a4892dff521b629b0a, type: 2}
chaseTarget: {fileID: 0}
stateTimeElapsed: 0
anim: {fileID: 0}
enemyCollider: {fileID: 0}
playerCharacter: {fileID: 0}
playerStateManager: {fileID: 0}
enemyIsStacking: 0
maxViewY: 0
enemyStats: {fileID: 11400000, guid: 2cdeda93f0ee3f642ad2a4b391c8699c, type: 2}
SpriteWidth: 0
OffsetRaycast: 0.2
aiActive: 0
--- !u!58 &830689614
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 830689612}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.1
--- !u!212 &830689615
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 830689612}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10754, 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_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300004, guid: ab814ad0d646e4d8eb5d179cfe2e09ba, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.2, y: 0.2}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!4 &830689616
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 830689612}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -6.99, y: -5.41, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!95 &830689617
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 830689612}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: 26bb36302bf704276a81dded8f51356c, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1 &1929776034
GameObject:
m_ObjectHideFlags: 0
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Patrol : MonoBehaviour {
private bool movingRight = true;
private float distance = 2.0f;
private float _distance = 8.0f;
private bool _isPatrolling;
private float spriteWidth;
private float aiSpeed = 3.0f;
// Update is called once per frame
public void StartPatroling()
{
transform.Translate(Vector2.right * aiSpeed * Time.deltaTime);
Vector2 edge = transform.position + transform.right * spriteWidth;
RaycastHit2D floorInfo = Physics2D.Raycast(edge, Vector2.down, distance);
Debug.DrawLine(edge, edge+Vector2.down*distance, Color.white);
if (!floorInfo.collider)
{
if (movingRight)
{
transform.eulerAngles = new Vector2(0, -180);
movingRight = false;
}
else
{
transform.eulerAngles = new Vector2(0, 0);
movingRight = true;
}
}
}
}
......@@ -15,15 +15,10 @@ public class AttackAction : Action {
private void Attack(StateControl controller)
{
controller.anim.SetBool("isWalking", false);
controller.anim.SetBool("isAttacking", true);
//controller.startRoutine(controller);
}
}
}
......@@ -29,16 +29,16 @@ public class ChaseAction : Action {
Vector2 edge = controller.transform.position + controller.transform.right * controller.SpriteWidth;
RaycastHit2D floorInfo = Physics2D.Raycast(edge, Vector2.down, 2.0f);
RaycastHit2D floorInfo = Physics2D.Raycast(edge, Vector2.down, 2.0f, GameLayer.WallMask);
Debug.DrawLine(edge, edge + Vector2.down * 2.0f, Color.white);
if (floorInfo.collider && controller.anim.GetCurrentAnimatorClipInfo(0)[0].clip.name == "Priest_Walking")
if (floorInfo.collider && controller.anim.GetCurrentAnimatorClipInfo(0)[0].clip.name == controller.enemyStats.walkingAnimationName)
{
controller.transform.position = Vector2.MoveTowards(controller.transform.position,
new Vector2(playerPos.x, controller.transform.position.y), 0.07f);
new Vector2(playerPos.x, controller.transform.position.y), 0.07f * Time.deltaTime);
}
......
......@@ -6,10 +6,13 @@ using UnityEngine;
public class DefaultEnemyStats : ScriptableObject
{
public float aiSpeed = 3.0f;
public float aiChaseSpeed = 5.0f;
public float lookRange = 10.0f;
public float attackRange = 3.0f;
public float attackRate = 0.0f;
public float attackDamage;
public float searchDuration = 5.0f;
public float attackDamage = 10.0f;
public string attackAnimationLoopName = "Priest_Attacking_Loop";
public string walkingAnimationName = "Priest_Walking";
public float fieldOfViewAngle = 60.0f;
public float maxWalkDistance = 20.0f;
}
......@@ -2,22 +2,15 @@
using System.Collections.Generic;
using UnityEngine;
public class LockPlayer : MonoBehaviour
{
public class EnemySkillController : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
public void playerLocked(Transform playerPos, float aiSpeed)
{
if (Vector2.Distance(transform.position, playerPos.position) < 10.0f)
{
transform.position = Vector2.MoveTowards(transform.position, new Vector2(playerPos.position.x, 0),
aiSpeed * Time.deltaTime);
}
void Update () {
}
}
fileFormatVersion: 2
guid: edf2f561c8db1480ab8c688d4eb7e34b
guid: f1f5098d2a1635c45aa1efd11da57162
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8da38fcc335044fab78116418ff46260, type: 3}
m_Name: PriestMaxHp
m_EditorClassIdentifier:
DeveloperDescription:
Value: 100
fileFormatVersion: 2
guid: 2cdeda93f0ee3f642ad2a4b391c8699c
guid: ea1c8662490e94149891a2d5a2386277
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
......
......@@ -9,12 +9,14 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 79a5f5087a822db4cb5b0a7fb4035426, type: 3}
m_Name: EnemyStats
m_Name: PriestStats
m_EditorClassIdentifier:
aiSpeed: 3
aiChaseSpeed: 5
lookRange: 10
attackRange: 3
attackRate: 0
attackDamage: 0
searchDuration: 5
attackDamage: 10
attackAnimationLoopName: Priest_Attacking_Loop
walkingAnimationName: Priest_Walking
fieldOfViewAngle: 60
maxWalkDistance: 20
fileFormatVersion: 2
guid: 4a5d33c77840ad844bbe2bdde9e7e53b
MonoImporter:
guid: e888c02191f13d34e81a5acaac0937fd
NativeFormatImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -8,20 +8,6 @@ public class GoAttackDecision: Decision{
public override bool Decide(StateControl controller)
{
/*
Vector3 edge = controller.transform.position + controller.transform.right * (controller.SpriteWidth + controller.OffsetRaycast);
RaycastHit2D hit = Physics2D.Raycast(edge, controller.transform.right, controller.enemyStats.attackRange);
Debug.DrawLine(edge, edge + controller.transform.right * controller.enemyStats.attackRange, Color.red);
float colliderDist = Physics2D.Distance(controller.enemyCollider, controller.playerStateManager.collider).distance;
if (!hit.collider)
{
return true;
}
*/
float distance = controller.enemyCollider.transform.position.x -
controller.playerStateManager.collider.transform.position.x;
......@@ -30,9 +16,7 @@ public class GoAttackDecision: Decision{
{
RaycastHit2D hitInfo = Physics2D.Linecast(
new Vector2(controller.transform.position.x, controller.transform.position.y),
controller.playerStateManager.rigidb.position, GameLayer.WallMask);
//Debug.DrawLine(controller.transform.position,controller.playerStateManager.rigidb.position,Color.blue);
controller.playerStateManager.rigidb.position, GameLayer.WallMask);
if (!hitInfo.collider)
{
......
......@@ -19,9 +19,6 @@ public class LookDecision : Decision {
Vector2 normal = colliderDist.normal;
Debug.Log(controller.transform.forward.z);
if (controller.enemyStats.lookRange >= colliderDist.distance && Mathf.Abs(normal.y) < controller.maxViewY &&
(normal.x * controller.transform.forward.z) < 0)
{
......
......@@ -23,9 +23,9 @@ public class PatrolAction : Action
Vector2 edge = controller.transform.position + controller.transform.right * controller.SpriteWidth;
RaycastHit2D floorInfo = Physics2D.Raycast(edge, Vector2.down, 2.0f);
RaycastHit2D floorInfo = Physics2D.Raycast(edge, Vector2.down, 2.0f, GameLayer.WallMask);
//Debug.DrawLine(edge, edge + Vector2.down * 2.0f, Color.white);
Debug.DrawLine(edge, edge + Vector2.down, Color.white);
if (!floorInfo.collider)
{
......
......@@ -21,13 +21,25 @@ public class StateControl : MonoBehaviour {
[HideInInspector] public PlayerStateManager playerStateManager;