You need help for something ? Go to https://xr4dev.pages.xr4all.eu

Commit aa7951d4 authored by aradjafari's avatar aradjafari

invoke function is removed

parent 6d0044c9
Pipeline #3613 failed with stages
in 36 seconds
......@@ -32,7 +32,7 @@ namespace MirageXR
//Animation variables
private bool animationClipPlaying;
private bool animationPlayedOnce;
public bool characterParsed {
public bool CharacterParsed {
get; private set;
}
......@@ -251,7 +251,7 @@ namespace MirageXR
//wait for the character be setup by using JSON data
await ActivateCharacterOnEnable();
characterParsed = true;
CharacterParsed = true;
//Remove animation clips which not exist for this character from the drobdown list
for (int i = animationMenu.options.Count - 1; i > 0; i--)
......@@ -329,7 +329,7 @@ namespace MirageXR
triggerDuration = DialogRecorder.DialogLength() >= animationLength ? DialogRecorder.DialogLength() : animationLength;
if (!_anim || !_agent || MovementType == string.Empty || !characterParsed ) return;
if (!_anim || !_agent || MovementType == string.Empty || !CharacterParsed ) return;
//Deactivate the animation selector if movement is follow path and loop is on
animationMenu.interactable = !(AgentReturnAtTheEnd && !movementManger.FollowPlayer.isOn);
......@@ -366,7 +366,7 @@ namespace MirageXR
private void AddWatsonAssistant()
{
if (AIActivated && characterParsed) return;
if (AIActivated && CharacterParsed) return;
//stop dialog recording before activating AI
if (DialogRecorder.isRecording)
......@@ -425,7 +425,7 @@ namespace MirageXR
private void OnTriggerValueChanged()
{
if (!characterParsed) return;
if (!CharacterParsed) return;
if (_characterSetting.Trigger.isOn)
{
......@@ -584,7 +584,7 @@ namespace MirageXR
public void SaveJson()
{
if (_myObj == null || string.IsNullOrEmpty(_myObj.poi) || !characterParsed) return; //only if the character is instantiated not the prefab
if (_myObj == null || string.IsNullOrEmpty(_myObj.poi) || !CharacterParsed) return; //only if the character is instantiated not the prefab
var character = new Character();
......@@ -827,7 +827,7 @@ namespace MirageXR
private void OnAnimationLoopToggle()
{
if (!characterParsed) return;
if (!CharacterParsed) return;
if (_characterSetting.AnimationLoopToggle.isOn) animationClipPlaying = false;
AnimationLoop = _characterSetting.AnimationLoopToggle.isOn;
......@@ -835,7 +835,7 @@ namespace MirageXR
private void OnAnimationClipChanged()
{
if (!characterParsed) return;
if (!CharacterParsed) return;
StartCoroutine(OnImageDisplayIntro(true));
animationClipPlaying = false;
......
......@@ -110,7 +110,7 @@ namespace MirageXR
private void FixedUpdate()
{
if (!MyCharacter || !MyCharacter.characterParsed) return;
if (!MyCharacter || !MyCharacter.CharacterParsed) return;
if (MyCharacter.AnyNodeMoving)
AvoidSpatialCover();
......
using System.IO;
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
namespace MirageXR
{
......@@ -37,9 +38,14 @@ namespace MirageXR
bool isPlaying;
public bool isRecording { get; private set; }
private void Start()
private IEnumerator Start()
{
Invoke(nameof(Init), 500);
while (!MyCharacter.CharacterParsed)
{
yield return null;
}
Init();
SetEditorState(ActivityManager.Instance.EditModeActive);
}
......@@ -48,16 +54,22 @@ namespace MirageXR
get; set;
}
private async void Init()
{
DialogSaveName = $"characterinfo/{ActivityManager.Instance.ActiveActionId}_{MyCharacter.MyToggleObject().poi}.wav";
//For character who has lipsync the audio source is added to the object with ThreeLSControl component
var threeLSControl = MyCharacter.GetComponentInChildren<ThreeLSControl>();
if(threeLSControl)
if(threeLSControl)
{
_audioSource = threeLSControl.GetComponent<AudioSource>();
}
else
{
_audioSource = MyCharacter.GetComponent<AudioSource>();
}
MyCharacter.GetComponent<CharacterController>().AudioEditorCheck();
_audioEditor = MyCharacter.MyAudioEditor;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment