Added Enemies in Cave

Also prepared Wizard Script
This commit is contained in:
KrolMel 2022-12-11 23:06:16 +01:00
parent f0edea12e1
commit cd678552bb
15 changed files with 13550 additions and 441 deletions

View File

@ -55,6 +55,13 @@ public class NewGame : MonoBehaviour
PlayerPrefs.SetInt("StrengthPoints", 0);
PlayerPrefs.SetInt("IntelligencePoints", 0);
//NPC ACTIONS HERE ----------------------------------------------------
PlayerPrefs.SetInt("Wizard.FirstDialogue", 0);
// --------------------------------------------------------------------
OnMapAppearanceMethod.SetNewGameStatus();
// remove all binary files from Application.persistentDataPath + "/";

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 83064c7a2cb85f74cb490800dd75f8e7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b2d4c88a1e7390c41b8fe80d131d4042
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,216 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4759712171538235754
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4759712171538235753}
- component: {fileID: 4759712171538235752}
- component: {fileID: 4759712171538235748}
- component: {fileID: 4759712171538235749}
- component: {fileID: -8463239967595622325}
- component: {fileID: 4759712171538235750}
- component: {fileID: 7232042190984337245}
- component: {fileID: -7576677615092044163}
m_Layer: 0
m_Name: Wizard
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4759712171538235753
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4759712171538235754}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.9412931, y: -2.068871, z: 133.20683}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &4759712171538235752
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4759712171538235754}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
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_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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: 3
m_Sprite: {fileID: 2429924255151692236, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1.1875, y: 1.8125}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!50 &4759712171538235748
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4759712171538235754}
m_BodyType: 2
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 1
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!58 &4759712171538235749
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4759712171538235754}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 1.5
--- !u!114 &-8463239967595622325
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4759712171538235754}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a13ccc76cd22a814287fc3a36a9cac71, type: 3}
m_Name:
m_EditorClassIdentifier:
Name: Wizard
--- !u!114 &4759712171538235750
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4759712171538235754}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a6e7fe9a7e85294fbf51884f7313f11, type: 3}
m_Name:
m_EditorClassIdentifier:
SpeakerName: Wizard
DialogueTemplate: {fileID: 11400000, guid: d4f0b63e09b976d4a81990d13d767629, type: 2}
Dialogue: {fileID: 0}
EndactionEventList:
- Key:
Key: 0
Value: 0
Value:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7232042190984337245}
m_TargetAssemblyTypeName: NPCFollowing, Assembly-CSharp
m_MethodName: AfterAction
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &7232042190984337245
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4759712171538235754}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5a582cacb34cf5c49a4c572aa826a582, type: 3}
m_Name:
m_EditorClassIdentifier:
anim: {fileID: 0}
homePosition: {fileID: 0}
targetPosition: {fileID: 0}
agent: {fileID: -7576677615092044163}
player: {fileID: 0}
approaching: 0
isAfterAction: 0
isDuringConversation: 0
actionRadius: 1
state: 1
--- !u!114 &-7576677615092044163
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4759712171538235754}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d622984048644f87804ad1a3f20aa23a, type: 3}
m_Name:
m_EditorClassIdentifier:
speed: 1
currentPosition:
GCost: 0
hCost: 0
walkable: 0
worldPosition: {x: 0, y: 0, z: 0}
gridPosition: {x: 0, y: 0}
path: []

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 417d111e604a8124cb960805d809e513
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -48575,60 +48575,7 @@ MonoBehaviour:
ChestType: 0
Content: []
UiManager: {fileID: 0}
ElementsToBuildOnSceneList:
- Name:
PrefabAssetName:
Position:
- -409.8
- -216.4
- 10
ChestData:
id: 0
name: Wooden Chest 1
modelName: Wooden Chest
description:
type: 0
content:
- Key: 4
Value:
id: 0
name: Pickaxe
modelName: Pickaxe
description:
level: 0
imageName:
strengthBonus: 0
agilityBonus: 0
inteligenceBonus: 0
vitalityBonus: 0
isStackable: 0
equipmentType: 5
- Name:
PrefabAssetName:
Position:
- -382
- -201
- 10
ChestData:
id: 0
name: Gold Chest 2
modelName: Gold Chest
description:
type: 2
content: []
- Name:
PrefabAssetName:
Position:
- -376.5
- -224.8
- 10
ChestData:
id: 0
name: Wooden Chest
modelName: Wooden Chest
description:
type: 0
content: []
ElementsToBuildOnSceneList: []
convertedData: []
--- !u!1 &1567981116
GameObject:

File diff suppressed because it is too large Load Diff

View File

@ -423,157 +423,11 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &52921957
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 52921958}
- component: {fileID: 52921959}
- component: {fileID: 52921963}
- component: {fileID: 52921962}
- component: {fileID: 52921961}
- component: {fileID: 52921960}
m_Layer: 0
m_Name: Wizard
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &52921958
--- !u!4 &52921958 stripped
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
m_PrefabInstance: {fileID: 4759712171552950031}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52921957}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.9412931, y: -2.068871, z: 133.20683}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1393757793}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &52921959
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52921957}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
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_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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: 3
m_Sprite: {fileID: 2429924255151692236, guid: a618c1a6d5f6e29438eeadfa55fcea33, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1.1875, y: 1.8125}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &52921960
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52921957}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3c776521de96c694bae24caa54802f59, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &52921961
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52921957}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a6e7fe9a7e85294fbf51884f7313f11, type: 3}
m_Name:
m_EditorClassIdentifier:
SpeakerName: Wizard
DialogueTemplate: {fileID: 11400000, guid: d4f0b63e09b976d4a81990d13d767629, type: 2}
Dialogue: {fileID: 0}
EndactionEventList: []
--- !u!58 &52921962
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52921957}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 1.5
--- !u!50 &52921963
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 52921957}
m_BodyType: 2
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 1
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!1 &62025658
GameObject:
m_ObjectHideFlags: 0
@ -38502,3 +38356,76 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2141892240}
m_CullTransparentMesh: 1
--- !u!1001 &4759712171552950031
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1393757793}
m_Modifications:
- target: {fileID: 4759712171538235749, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_Radius
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235750, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: EndactionEventList.Array.data[0].Value.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 7232042190984337245, guid: 417d111e604a8124cb960805d809e513, type: 3}
- target: {fileID: 4759712171538235750, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: EndactionEventList.Array.data[0].Value.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: AfterAction
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalPosition.x
value: -1.9412931
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalPosition.y
value: -2.068871
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalPosition.z
value: 133.20683
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235753, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4759712171538235754, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: m_Name
value: Wizard
objectReference: {fileID: 0}
- target: {fileID: 7232042190984337245, guid: 417d111e604a8124cb960805d809e513, type: 3}
propertyPath: approaching
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 417d111e604a8124cb960805d809e513, type: 3}

View File

@ -0,0 +1,153 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NPCFollowing : MonoBehaviour
{
private Rigidbody2D myRigidbody;
public Animator anim;
public Transform homePosition;
public Transform targetPosition;
public AStarPathfindingAgent agent;
public GameObject player;
public bool approaching = false;
public bool isAfterAction = false;
public bool isDuringConversation = false;
public float actionRadius = 1.0f;
public NPCStateEnum state = NPCStateEnum.Pending;
void Awake()
{
//agent = GetComponent<AStarPathfindingAgent>();
}
// Start is called before the first frame update
void Start()
{
isAfterAction = System.Convert.ToBoolean(PlayerPrefs.GetInt(gameObject.GetComponent<NPC>().name + ".FirstDialogue"));
state = NPCStateEnum.Walking;
myRigidbody = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
targetPosition = GameObject.FindWithTag("Player").transform;
}
// Update is called once per frame
public void Update()
{
HandleState();
}
public void CheckDistance()
{
StopAllCoroutines();
if (isAfterAction == false)
{
if (approaching && Vector2.Distance(targetPosition.position, transform.position) >= actionRadius)
{
Debug.Log(agent);
agent.FindPath();
//transform.position = Vector2.MoveTowards(transform.position, target.position, moveSpeed * Time.deltaTime);
StartCoroutine(agent.FollowPath());
}
/* else if (Vector2.Distance(target.position, transform.position) > chaseRadius)
{
//Debug.Log(Vector2.Distance(transform.position, path[currentPoint].position));
if (Vector2.Distance(transform.position, path[currentPoint].position) > roundingDistance)
{
StopAllCoroutines();
transform.position = Vector2.MoveTowards(transform.position, path[currentPoint].position, 2 * Time.deltaTime);
}
else
{
changeGoal();
}
}*/
else if (approaching)
{
//start dialogue here we want uga bunga
state = NPCStateEnum.Talking;
}
}
else if (!approaching && isAfterAction)
{
if (Vector2.Distance(transform.position, homePosition.position) > 1)
{
transform.position = Vector2.MoveTowards(transform.position, homePosition.position, 2 * Time.deltaTime);
}
else
{
state = NPCStateEnum.Pending;
}
}
}
public void OnTriggerExit2D(Collider2D other)
{
if (approaching && !isAfterAction)
{
gameObject.GetComponent<NpcDialogueManager>().Dialogue.BreakDialogueStep();
isDuringConversation = false;
state = NPCStateEnum.Walking;
}
}
public void HandleState()
{
switch (state)
{
case NPCStateEnum.Walking:
{
CheckDistance();
break;
}
case NPCStateEnum.Talking:
{
DoAction();
break;
}
case NPCStateEnum.Pending:
{
break;
}
default:
{
Debug.Log("fancy text nie wiem co zrobic");
break;
}
}
}
public void DoAction()
{
if (approaching == true && isDuringConversation == false)
{
isDuringConversation = true;
gameObject.GetComponent<NpcDialogueManager>().Dialogue.StartDialogue();
}
}
public void AfterAction()
{
approaching = false;
isAfterAction = true;
PlayerPrefs.SetInt(gameObject.name + ".FirstDialogue", System.Convert.ToInt32(isAfterAction));
state = NPCStateEnum.Walking;
}
public void SaveCheckpoint()
{
//PlayerPrefs.SetInt(enemyName + "-S", isKilled);
}
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3c776521de96c694bae24caa54802f59
guid: 5a582cacb34cf5c49a4c572aa826a582
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@ -1,37 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Wizard : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Player")
{
Debug.Log("OnTriggerEnter2D");
gameObject.GetComponent<NpcDialogueManager>().Dialogue.StartDialogue();
}
}
public void OnTriggerExit2D(Collider2D other)
{
if (other.tag == "Player")
{
gameObject.GetComponent<NpcDialogueManager>().Dialogue.BreakDialogueStep();
}
}
}

View File

@ -0,0 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NPC : MonoBehaviour
{
public string Name;
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a13ccc76cd22a814287fc3a36a9cac71
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,14 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public enum NPCStateEnum
{
None,
Pending,
Walking,
Attacking,
Talking,
Trading
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d70ef81578999254aa199694decb74a8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: