2022-06-14 15:54:28 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class NPCType : MonoBehaviour
|
|
|
|
{
|
2022-06-15 16:32:14 +02:00
|
|
|
|
|
|
|
public GameObject lumberjack;
|
2022-06-14 15:54:28 +02:00
|
|
|
public int isQuest;
|
2022-06-15 16:32:14 +02:00
|
|
|
public string name;
|
2022-06-15 19:54:44 +02:00
|
|
|
public string name2;
|
2022-06-15 16:32:14 +02:00
|
|
|
|
|
|
|
void Start()
|
|
|
|
{
|
2022-06-15 19:54:44 +02:00
|
|
|
|
2022-06-15 16:32:14 +02:00
|
|
|
NPCDialogue npcdialogue = lumberjack.GetComponent<NPCDialogue>();
|
|
|
|
name = npcdialogue.name;
|
2022-06-15 19:54:44 +02:00
|
|
|
int continued = PlayerPrefs.GetInt("continued");
|
|
|
|
if (continued == 1)
|
|
|
|
{
|
|
|
|
isQuest = PlayerPrefs.GetInt(name2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
isQuest = PlayerPrefs.GetInt(name);
|
|
|
|
}
|
2022-06-15 16:32:14 +02:00
|
|
|
npcdialogue.isQuest = isQuest;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
NPCDialogue npcdialogue = lumberjack.GetComponent<NPCDialogue>();
|
|
|
|
isQuest = npcdialogue.isQuest;
|
|
|
|
PlayerPrefs.SetInt(name, isQuest);
|
|
|
|
}
|
2022-06-15 19:54:44 +02:00
|
|
|
|
|
|
|
public void SaveCheckpoint()
|
|
|
|
{
|
|
|
|
NPCDialogue npcdialogue = lumberjack.GetComponent<NPCDialogue>();
|
|
|
|
isQuest = npcdialogue.isQuest;
|
|
|
|
PlayerPrefs.SetInt(name2, isQuest);
|
|
|
|
}
|
2022-06-14 15:54:28 +02:00
|
|
|
}
|