Dialogues - fix dynamic language detection
This commit is contained in:
parent
35ed59b247
commit
13051eb240
@ -13,7 +13,6 @@ public class PatrollingEnemy : Enemy
|
||||
//public Transform target;
|
||||
public Animator anim;
|
||||
|
||||
public int isKilled;
|
||||
//isKilled = 0 - mob ALIVE
|
||||
//isKilled = 1 - mob DEAD
|
||||
|
||||
|
@ -52,6 +52,14 @@ public class DialogueManager : MonoBehaviour
|
||||
{
|
||||
if (OpenInDefaultWay && Input.GetKeyDown(keyToOpen) && OpenPanelCondition())
|
||||
{
|
||||
if (languageDetector.InstanceTemplates.Count() > 0)
|
||||
{
|
||||
// create and config dailogue
|
||||
CreateInstanceBasedOnLanguage();
|
||||
|
||||
Dialogue.BuildCurrentDialogue();
|
||||
}
|
||||
|
||||
OpenDialoguePanel();
|
||||
}
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ public class NpcMissionManager : DialogueManager // ScriptableObject
|
||||
CanBeOpened = false;
|
||||
OpenInDefaultWay = false;
|
||||
|
||||
CreateInstanceBasedOnLanguage();
|
||||
|
||||
CreateInstanceBasedOnLanguage();
|
||||
|
||||
// UPDATE DIALOGUE
|
||||
// search in scene manager list
|
||||
@ -53,7 +53,6 @@ public class NpcMissionManager : DialogueManager // ScriptableObject
|
||||
Mission.BuildMission();
|
||||
|
||||
|
||||
|
||||
if (FreeDialogue != null)
|
||||
FreeDialogue.Build();
|
||||
}
|
||||
@ -70,6 +69,29 @@ public class NpcMissionManager : DialogueManager // ScriptableObject
|
||||
{
|
||||
CanBeOpened = true;
|
||||
|
||||
|
||||
CreateInstanceBasedOnLanguage();
|
||||
|
||||
|
||||
// UPDATE DIALOGUE
|
||||
// search in scene manager list
|
||||
if (Mission != null)
|
||||
{
|
||||
var machedDialogueData = ((MissionDataManager)MissionDataManager.Instance).GetMission(Mission);
|
||||
|
||||
if (machedDialogueData != null)
|
||||
{
|
||||
UpdateMissionState(machedDialogueData);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Start - UpdateProggres");
|
||||
UpdateProggres();
|
||||
}
|
||||
}
|
||||
|
||||
Mission.BuildMission();
|
||||
|
||||
Mission.StartDialogue();
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,14 @@ public class NpcDialogueManager : DialogueManager
|
||||
CanBeOpened = false;
|
||||
OpenInDefaultWay = false;
|
||||
|
||||
if (languageDetector.InstanceTemplates.Count() > 0)
|
||||
{
|
||||
// create and config dailogue
|
||||
CreateInstanceBasedOnLanguage();
|
||||
|
||||
Dialogue.BuildCurrentDialogue();
|
||||
}
|
||||
|
||||
// UPDATE DIALOGUE
|
||||
// search in scene manager list
|
||||
if (Dialogue != null)
|
||||
@ -36,6 +44,31 @@ public class NpcDialogueManager : DialogueManager
|
||||
{
|
||||
if (Input.GetKeyDown(keyToOpen) && OpenPanelCondition())
|
||||
{
|
||||
// Refrsh dialogue language and proggres after each opening trial
|
||||
if (languageDetector.InstanceTemplates.Count() > 0)
|
||||
{
|
||||
// create and config dailogue
|
||||
CreateInstanceBasedOnLanguage();
|
||||
|
||||
Dialogue.BuildCurrentDialogue();
|
||||
}
|
||||
|
||||
// UPDATE DIALOGUE
|
||||
// search in scene manager list
|
||||
if (Dialogue != null)
|
||||
{
|
||||
var machedDialogueData = ((MultiDialogueDataManager)MultiDialogueDataManager.Instance).GetDialogue(Dialogue);
|
||||
|
||||
if (machedDialogueData != null)
|
||||
{
|
||||
UpdateDialogueState(machedDialogueData);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateProggres();
|
||||
}
|
||||
}
|
||||
|
||||
OpenDialoguePanel();
|
||||
}
|
||||
}
|
||||
|
@ -68,6 +68,8 @@ public class NpcShopManager : MonoBehaviour
|
||||
*/
|
||||
if (gameObject.GetComponent<NpcDialogueManager>().CanBeOpened && Input.GetKeyDown(ShopUIManager.Instance.keyToOpen) && !ShopUIManager.Instance.GetPanelStatus())
|
||||
{
|
||||
CreateInstanceBasedOnLanguage();
|
||||
|
||||
// Open dialogue panel (Shop will be opened later)
|
||||
Dialogue.StartDialogue();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user