浏览代码

Now townsfolk stop talking when one of them interact with chef

/main
Amel Negra 4 年前
当前提交
507e39d5
共有 1 个文件被更改,包括 30 次插入16 次删除
  1. 46
      UOP1_Project/Assets/Scripts/Quests/StepController.cs

46
UOP1_Project/Assets/Scripts/Quests/StepController.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
//this script needs to be put on the actor, and takes care of the current step to accomplish.
//the step contains a dialogue and maybe an event.

[SerializeField] private VoidEventChannelSO _loseDialogueEvent = default;
[Header("Broadcasting on channels")]
[SerializeField] private DialogueDataChannelSO _startDialogueEvent = default;
//[SerializeField]
public DialogueDataChannelSO _startDialogueEvent = default;
[SerializeField] private VoidEventChannelSO _endDialogueEvent = default;
//[SerializeField]
public VoidEventChannelSO _endDialogueEvent = default;
private DialogueDataSO _currentDialogue;
public bool isInDialogue; //Consumed by the state machine
private DialogueDataSO _currentDialogue;
public bool IsInDialogue = false;
}
void PlayDefaultDialogue()

void StartDialogue()
{
IsInDialogue = true;
StopTalkingToCurrentActor();
isInDialogue = true;
IsInDialogue = false;
ResumeTalkingToCurrentActor();
isInDialogue = false;
}
void PlayLoseDialogue()

}
}
void PlayWinDialogue()
{
if (_questData != null)

_currentDialogue = displayDialogue;
StartDialogue();
}
}
}
private void StopTalkingToCurrentActor()
{
GameObject[] talkingTo = gameObject.GetComponent<Townsfolk>().talkingTo;
for (int i = 0; i < talkingTo.Length; ++i)
{
talkingTo[i].GetComponent<Townsfolk>().townsfolkState = TownsfolkState.Idle;
}
}
private void ResumeTalkingToCurrentActor()
{
GameObject[] talkingTo = GetComponent<Townsfolk>().talkingTo;
for (int i = 0; i < talkingTo.Length; ++i)
{
talkingTo[i].GetComponent<Townsfolk>().townsfolkState = TownsfolkState.Talk;
}
}
正在加载...
取消
保存