SpawnOnStart.cs
Code: Select all
using UnityEngine;
using PixelCrushers.QuestMachine;
public class SpawnOnStart : MonoBehaviour
{
public StringField questID;
public QuestState requiredState = QuestState.Active;
public GameObject prefabToSpawn;
void Start()
{
if (QuestMachine.GetQueststate(questID) == requiredState)
{
Instantiate(prefabToSpawn);
}
}
}