SkipCtrl - Build Issue
Posted: Tue Feb 27, 2018 3:18 pm
Hi Tony,
Just ran into a bit of a strange one. I'm using a script to skip ahead text to the next response menu from a thread here, couple of slight modifications but nothing major. It has always worked fine however today I have created some content no different than before and figured I'd build and see how it plays.
The skip script stops working when I build and fails to work in both the build and the unity editor until I close the editor and open the project again. This is the full script in use;
Any idea why this would stop working after a build? I'm completely puzzled.
I have numbered the two parts where the error below points to.
Errors;
NullReferenceException: Object reference not set to an instance of an object
SkipButtonCtrl.SkipToResponseMenu () (at Assets/SkipButtonCtrl.cs:34)
SkipButtonCtrl.Update () (at Assets/SkipButtonCtrl.cs:13)
When I start to just hit space to skip ahead, the following error appears as well;
NullReferenceException: Object reference not set to an instance of an object
SkipButtonCtrl+<ContinueAtEndOfFrame>c__Iterator0.MoveNext () (at Assets/SkipButtonCtrl.cs:50)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
Cheers
Just ran into a bit of a strange one. I'm using a script to skip ahead text to the next response menu from a thread here, couple of slight modifications but nothing major. It has always worked fine however today I have created some content no different than before and figured I'd build and see how it plays.
The skip script stops working when I build and fails to work in both the build and the unity editor until I close the editor and open the project again. This is the full script in use;
Code: Select all
using UnityEngine;
using System.Collections;
using PixelCrushers.DialogueSystem;
public class SkipButtonCtrl : MonoBehaviour
{
void Update()
{
if (Time.timeScale != 0) {
if (Input.GetKeyUp (KeyCode.LeftControl)) {
13> SkipToResponseMenu ();
}
}
}
public bool skip;
private AbstractDialogueUI dialogueUI;
private void Awake()
{
if (Time.timeScale != 0) {
dialogueUI = GetComponentInChildren<AbstractDialogueUI> ();
}
}
public void SkipToResponseMenu()
{
if (Time.timeScale != 0) {
skip = true;
34> dialogueUI.OnContinue();
}
}
void OnConversationLine(Subtitle subtitle)
{
if (Time.timeScale != 0) {
if (skip)
StartCoroutine (ContinueAtEndOfFrame ());
}
}
IEnumerator ContinueAtEndOfFrame()
{
yield return new WaitForEndOfFrame();
50> dialogueUI.OnContinue();
}
void OnConversationResponseMenu(Response[] responses)
{
skip = false;
}
void OnConversationEnd(Transform actor)
{
skip = false;
}
}
I have numbered the two parts where the error below points to.
Errors;
NullReferenceException: Object reference not set to an instance of an object
SkipButtonCtrl.SkipToResponseMenu () (at Assets/SkipButtonCtrl.cs:34)
SkipButtonCtrl.Update () (at Assets/SkipButtonCtrl.cs:13)
When I start to just hit space to skip ahead, the following error appears as well;
NullReferenceException: Object reference not set to an instance of an object
SkipButtonCtrl+<ContinueAtEndOfFrame>c__Iterator0.MoveNext () (at Assets/SkipButtonCtrl.cs:50)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
Cheers