Hi,
I am trying to trigger a cutscene in c# using a condition referring to another c# script (QuestIt addon - Quest Manager script (QM in the below script)). I need the cutscene when a quest is done. I know my condition is good since I use it for a final cutscene in another level and it works perfectly. But I need to use a coroutine for the internal cutscenes since once my condition is true, the cutscene will always loop and I don't want this.
I don't understand the c# syntax very well yet. I use it only because I don't know how to use the same condition in Javascript.
I would really appreciate your help.
I get this error: Assets/Script/cutscenes_trigger.cs(21,14): error CS1624: The body of `cutscenes_trigger.CutScene()' cannot be an iterator block because`void' is not an iterator interface type
Here is the script I am using:
using UnityEngine;
using System.Collections;
public class cutscenes_trigger : MonoBehaviour
{
public GameObject cuts_cam;
public GameObject main_cam;
public int questID;
private bool isCutscene = false;
void Update()
{
if(QM.Ins.GetQuestStatus(questID) == questConditions.DONE && !isCutscene)
{
isCutscene = true;
CutScene();
}
}
void CutScene()
{
cuts_cam.active(true);
main_cam.active(false);
yield return new WaitForSeconds(4);
cuts_cam.active(false);
main_cam.active(true);
}
}