quests fixed
This commit is contained in:
parent
d46e3350f7
commit
54f60c067e
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
|
@ -56,5 +56,5 @@
|
|||
"temp/": true,
|
||||
"Temp/": true
|
||||
},
|
||||
"dotnet.defaultSolution": "2DMMOMirror.sln"
|
||||
"dotnet.defaultSolution": "Archive.sln"
|
||||
}
|
||||
22
Assets/Resources/Quest_3.asset
Normal file
22
Assets/Resources/Quest_3.asset
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb4f7aac1a911412f89952ac827aabad, type: 3}
|
||||
m_Name: Quest_3
|
||||
m_EditorClassIdentifier:
|
||||
questName: Quest_3
|
||||
questLines:
|
||||
- Quest 3
|
||||
- There is a monster living near my house
|
||||
- Kill it and i will reward you 500coins
|
||||
- be safe
|
||||
questTitle: Go near Farmers house and kill the monster
|
||||
rewardAmount: 500
|
||||
8
Assets/Resources/Quest_3.asset.meta
Normal file
8
Assets/Resources/Quest_3.asset.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 48ab8cb3db18f59408bda656f4c757d1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22
Assets/Resources/Quest_4.asset
Normal file
22
Assets/Resources/Quest_4.asset
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb4f7aac1a911412f89952ac827aabad, type: 3}
|
||||
m_Name: Quest_4
|
||||
m_EditorClassIdentifier:
|
||||
questName: Quest_4
|
||||
questLines:
|
||||
- Quest 4
|
||||
- There is a monster living near my house
|
||||
- Kill it and i will reward you 500coins
|
||||
- be safe
|
||||
questTitle: Go near Farmers house and kill the monster
|
||||
rewardAmount: 500
|
||||
8
Assets/Resources/Quest_4.asset.meta
Normal file
8
Assets/Resources/Quest_4.asset.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f68efb33c00239a41b5809f66a35636d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -38,6 +38,7 @@ RenderSettings:
|
|||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
|
|
@ -1405,7 +1406,7 @@ PrefabInstance:
|
|||
- target: {fileID: 3530665248377829069, guid: 3aaafdbd6af9342f9957f090c1e10e5b, type: 3}
|
||||
propertyPath: questData.Array.data[1]
|
||||
value:
|
||||
objectReference: {fileID: 11400000, guid: 0967722f082ec4153906c504edf5c45c, type: 2}
|
||||
objectReference: {fileID: 11400000, guid: 48ab8cb3db18f59408bda656f4c757d1, type: 2}
|
||||
- target: {fileID: 3530665248377829069, guid: 3aaafdbd6af9342f9957f090c1e10e5b, type: 3}
|
||||
propertyPath: questData.Array.data[2]
|
||||
value:
|
||||
|
|
@ -327968,15 +327969,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0.3, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -328060,15 +328059,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -458672,15 +458669,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: -7909654892493620595, guid: cd20e8790f3e4884ca3c74989aa84a83, type: 3}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -589106,15 +589101,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 2
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -636541,15 +636534,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 4.34, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -637133,15 +637124,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -651801,15 +651790,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 2
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -651890,15 +651877,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -685109,15 +685094,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 0
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 0001030405
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -685183,15 +685166,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 0
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 0001030405
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -699784,15 +699765,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 2
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -709552,15 +709531,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 2
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -709645,15 +709622,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 2
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -714811,15 +714786,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -715264,15 +715237,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 2
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -755466,15 +755437,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: -7909654892493620595, guid: cd20e8790f3e4884ca3c74989aa84a83, type: 3}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -756390,15 +756359,13 @@ ParticleSystemRenderer:
|
|||
m_RenderAlignment: 0
|
||||
m_Pivot: {x: 0, y: 0.3, z: 0}
|
||||
m_Flip: {x: 0, y: 0, z: 0}
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_EnableGPUInstancing: 1
|
||||
m_ApplyActiveColorSpace: 1
|
||||
m_AllowRoll: 1
|
||||
m_FreeformStretching: 0
|
||||
m_RotateWithStretchDirection: 1
|
||||
m_UseCustomVertexStreams: 0
|
||||
m_VertexStreams: 00010304
|
||||
m_UseCustomTrailVertexStreams: 0
|
||||
m_TrailVertexStreams: 00010304
|
||||
m_Mesh: {fileID: 0}
|
||||
m_Mesh1: {fileID: 0}
|
||||
m_Mesh2: {fileID: 0}
|
||||
|
|
@ -761407,7 +761374,11 @@ PrefabInstance:
|
|||
- target: {fileID: 3530665248377829069, guid: 3aaafdbd6af9342f9957f090c1e10e5b, type: 3}
|
||||
propertyPath: questData.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 11400000, guid: 1cb9f6811a18b4c9791b486d19534c28, type: 2}
|
||||
objectReference: {fileID: 11400000, guid: 0967722f082ec4153906c504edf5c45c, type: 2}
|
||||
- target: {fileID: 3530665248377829069, guid: 3aaafdbd6af9342f9957f090c1e10e5b, type: 3}
|
||||
propertyPath: questData.Array.data[1]
|
||||
value:
|
||||
objectReference: {fileID: 11400000, guid: f68efb33c00239a41b5809f66a35636d, type: 2}
|
||||
- target: {fileID: 7689119093168154079, guid: 3aaafdbd6af9342f9957f090c1e10e5b, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 7.222348
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ public class npcScript : MonoBehaviour
|
|||
public GameObject textBtn;
|
||||
public TMP_Text npcText;
|
||||
// public string[] texts;
|
||||
public QuestScriptable [] questData;
|
||||
public int activeQuest;
|
||||
private int index;
|
||||
public QuestScriptable[] questData;
|
||||
public int activeQuest=0;
|
||||
public int questLineIndex;
|
||||
|
||||
//public GameObject questUI;
|
||||
|
||||
|
|
@ -22,99 +22,132 @@ public class npcScript : MonoBehaviour
|
|||
|
||||
void Update()
|
||||
{
|
||||
if(isPlayerClose){
|
||||
// if(npcPanel.activeInHierarchy){
|
||||
// ResetTexts();
|
||||
// }else{
|
||||
// npcPanel.SetActive(true);
|
||||
// StartCoroutine(textLoad());
|
||||
// }
|
||||
if (isPlayerClose)
|
||||
{
|
||||
|
||||
}
|
||||
if(npcText.text == questData[activeQuest].questLines[index]){
|
||||
if (npcText.text == questData[activeQuest].questLines[questLineIndex])
|
||||
{
|
||||
textBtn.SetActive(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void ResetTexts(){
|
||||
npcPanel.SetActive(false);
|
||||
npcText.text = "";
|
||||
index = 0;
|
||||
}
|
||||
bool isLooping = false;
|
||||
IEnumerator textLoad(){
|
||||
isLooping = true;
|
||||
foreach(char letter in questData[activeQuest].questLines[index].ToCharArray()){
|
||||
bool isLoadingText = false;
|
||||
IEnumerator textLoad()
|
||||
{
|
||||
isLoadingText = true;
|
||||
foreach (char letter in questData[activeQuest].questLines[questLineIndex].ToCharArray())
|
||||
{
|
||||
npcText.text += letter;
|
||||
yield return new WaitForSecondsRealtime(textspeed);
|
||||
}
|
||||
isLooping=false;
|
||||
isLoadingText = false;
|
||||
}
|
||||
Coroutine textLoopAsync ;
|
||||
public void NextLine(){
|
||||
Coroutine textLoopAsync;
|
||||
public void NextLine()
|
||||
{
|
||||
textBtn.SetActive(false);
|
||||
if(index < questData[activeQuest].questLines.Length -1 ){
|
||||
index++;
|
||||
if (questLineIndex < questData[activeQuest].questLines.Length - 1)
|
||||
{
|
||||
questLineIndex++;
|
||||
npcText.text = "";
|
||||
LoadText();
|
||||
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetTexts();
|
||||
|
||||
//Start quest
|
||||
// questUI.SetActive(true);
|
||||
playerNetwork.localPlayerTransform.GetComponent<playerNetwork>().QuestFunction(questData[activeQuest]);
|
||||
playerNetwork.localPlayerTransform.GetComponent<playerNetwork>().SetActiveQuest(questData[activeQuest]);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D other) {
|
||||
if(other.CompareTag("Player")){
|
||||
|
||||
if(other.transform == playerNetwork.localPlayerTransform){
|
||||
if(playerNetwork.localPlayerTransform.GetComponent<playerNetwork>().currentQuest == questData[activeQuest]){
|
||||
void ResetTexts(){
|
||||
npcText.text = "";
|
||||
npcPanel.SetActive(false);
|
||||
}
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
if (other.CompareTag("Player"))
|
||||
{
|
||||
|
||||
if (other.transform == playerNetwork.localPlayerTransform)
|
||||
{
|
||||
playerNetwork pnet = playerNetwork.localPlayerTransform.GetComponent<playerNetwork>();
|
||||
if (pnet.currentQuest == questData[activeQuest]) //Already doing this quest
|
||||
{
|
||||
return;
|
||||
}
|
||||
for(int i =0; i < questData.Length; i++){
|
||||
bool isFound = false;
|
||||
foreach(string questName in playerNetwork.localPlayerTransform.GetComponent<playerNetwork>().completedQuests){
|
||||
if(questName == questData[i].name){
|
||||
isFound = true;
|
||||
|
||||
}
|
||||
|
||||
// for (int i = 0; i < questData.Length; i++)
|
||||
// {
|
||||
// bool isFound = false;
|
||||
// foreach (string questName in playerNetwork.localPlayerTransform.GetComponent<playerNetwork>().completedQuests)
|
||||
// {
|
||||
// if (questName == questData[i].name)
|
||||
// {
|
||||
// isFound = true;
|
||||
|
||||
// }
|
||||
// }
|
||||
// if (!isFound)
|
||||
// {
|
||||
// activeQuest = i;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
if(pnet.completedQuests.Contains(questData[activeQuest].questName)){ //Set next quest if current one is completed
|
||||
for(int i=0; i < questData.Length; i++){
|
||||
if(pnet.completedQuests.Contains(questData[i].questName)){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(!isFound){
|
||||
|
||||
activeQuest = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
isPlayerClose = true;
|
||||
if(npcPanel.activeInHierarchy){
|
||||
ResetTexts();
|
||||
}else{
|
||||
npcPanel.SetActive(true);
|
||||
LoadText();
|
||||
}
|
||||
|
||||
isPlayerClose = true;
|
||||
if (npcPanel.activeInHierarchy)
|
||||
{
|
||||
ResetTexts();
|
||||
}
|
||||
else
|
||||
{
|
||||
questLineIndex=0;
|
||||
|
||||
npcPanel.SetActive(true);
|
||||
LoadText();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void LoadText(){
|
||||
void LoadText()
|
||||
{
|
||||
npcText.text = "";
|
||||
if(textLoopAsync!=null){
|
||||
if (textLoopAsync != null)
|
||||
{
|
||||
StopCoroutine(textLoopAsync);
|
||||
}
|
||||
textLoopAsync = StartCoroutine(textLoad());
|
||||
}
|
||||
|
||||
private void OnTriggerExit2D(Collider2D other) {
|
||||
if(other.CompareTag("Player")){
|
||||
if(other.transform == playerNetwork.localPlayerTransform){
|
||||
isPlayerClose = false;
|
||||
ResetTexts();
|
||||
}
|
||||
private void OnTriggerExit2D(Collider2D other)
|
||||
{
|
||||
if (other.CompareTag("Player"))
|
||||
{
|
||||
if (other.transform == playerNetwork.localPlayerTransform)
|
||||
{
|
||||
isPlayerClose = false;
|
||||
ResetTexts();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ public class playerNetwork : NetworkBehaviour
|
|||
|
||||
public string selectedCharacterJson = CharacterSelection.selectedCharJson;
|
||||
|
||||
public void QuestFunction(QuestScriptable questData){
|
||||
public void SetActiveQuest(QuestScriptable questData){
|
||||
currentQuest = questData;
|
||||
questText.text = questData.questTitle;
|
||||
questUI.SetActive(true);
|
||||
|
|
@ -175,7 +175,7 @@ public class playerNetwork : NetworkBehaviour
|
|||
Debug.LogError("Completed a quest that wasnt active");
|
||||
return;
|
||||
}
|
||||
completedQuests.Add(currentQuest.name);
|
||||
completedQuests.Add(currentQuest.questName);
|
||||
currentQuest = null;
|
||||
|
||||
questText.text = "Quest Completed! Found 1000 coins from Cave-Chest";
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@
|
|||
"hash": "f8c8347af3a144069dffd6120f1c4142f8120891"
|
||||
},
|
||||
"com.unity.2d.animation": {
|
||||
"version": "9.1.3",
|
||||
"version": "9.0.3",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.2d.common": "8.0.4",
|
||||
"com.unity.2d.common": "8.0.1",
|
||||
"com.unity.2d.sprite": "1.0.0",
|
||||
"com.unity.collections": "1.1.0",
|
||||
"com.unity.modules.animation": "1.0.0",
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.2d.aseprite": {
|
||||
"version": "1.1.6",
|
||||
"version": "1.0.1",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.2d.common": {
|
||||
"version": "8.0.4",
|
||||
"version": "8.0.1",
|
||||
"depth": 2,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
|
|
@ -53,13 +53,13 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.2d.psdimporter": {
|
||||
"version": "8.0.5",
|
||||
"version": "8.0.2",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.2d.common": "8.0.2",
|
||||
"com.unity.2d.common": "8.0.1",
|
||||
"com.unity.2d.sprite": "1.0.0",
|
||||
"com.unity.2d.animation": "9.1.1"
|
||||
"com.unity.2d.animation": "9.0.1"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
|
|
@ -70,11 +70,11 @@
|
|||
"dependencies": {}
|
||||
},
|
||||
"com.unity.2d.spriteshape": {
|
||||
"version": "9.0.5",
|
||||
"version": "9.0.2",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.2d.common": "8.0.4",
|
||||
"com.unity.2d.common": "8.0.1",
|
||||
"com.unity.mathematics": "1.1.0",
|
||||
"com.unity.modules.physics2d": "1.0.0"
|
||||
},
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
}
|
||||
},
|
||||
"com.unity.2d.tilemap.extras": {
|
||||
"version": "3.1.3",
|
||||
"version": "3.1.1",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
|
|
@ -102,12 +102,11 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.burst": {
|
||||
"version": "1.8.18",
|
||||
"version": "1.8.8",
|
||||
"depth": 3,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.mathematics": "1.2.1",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
"com.unity.mathematics": "1.2.1"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
|
|
@ -140,14 +139,14 @@
|
|||
"depth": 0,
|
||||
"source": "builtin",
|
||||
"dependencies": {
|
||||
"com.unity.2d.animation": "9.1.3",
|
||||
"com.unity.2d.animation": "9.0.3",
|
||||
"com.unity.2d.pixel-perfect": "5.0.3",
|
||||
"com.unity.2d.psdimporter": "8.0.5",
|
||||
"com.unity.2d.psdimporter": "8.0.2",
|
||||
"com.unity.2d.sprite": "1.0.0",
|
||||
"com.unity.2d.spriteshape": "9.0.5",
|
||||
"com.unity.2d.spriteshape": "9.0.2",
|
||||
"com.unity.2d.tilemap": "1.0.0",
|
||||
"com.unity.2d.tilemap.extras": "3.1.3",
|
||||
"com.unity.2d.aseprite": "1.1.6"
|
||||
"com.unity.2d.tilemap.extras": "3.1.1",
|
||||
"com.unity.2d.aseprite": "1.0.1"
|
||||
}
|
||||
},
|
||||
"com.unity.ide.rider": {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
m_EditorVersion: 2022.3.53f1
|
||||
m_EditorVersionWithRevision: 2022.3.53f1 (df4e529d20d3)
|
||||
m_EditorVersion: 2022.3.10f1
|
||||
m_EditorVersionWithRevision: 2022.3.10f1 (ff3792e53c62)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user