using Naninovel;
using Naninovel.Commands;
using UniRx.Async;
using UnityEngine;
[CommandAlias("fadeOut")]
public class FadeOutCommand : Command
{
Animator screenAnimator;
public override UniTask ExecuteAsync(CancellationToken cancellationToken = default)
{
screenAnimator = GameObject.Find("BlackScreen").GetComponent<Animator>();
screenAnimator.Play("FadeOut");
return UniTask.CompletedTask;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectInteraction : MonoBehaviour
{
public string scriptName;
public Texture2D magnifierTexture;
[HideInInspector] public GameObject pressedObject;
CameraMovement cameraScript;
delegate void ClickedAction();
event ClickedAction clickEvents;
void Start()
{
cameraScript = GameObject.Find("Main Camera").GetComponent<CameraMovement>();
clickEvents += DirectorScript.directorSingleton.DisableObjectInteraction;
clickEvents += cameraScript.SetDirection;
}
public void OnMouseDown()
{
cameraScript.pressedObject = gameObject;
DirectorScript.directorSingleton.scriptName = scriptName;
clickEvents();
}
void OnMouseEnter()
{
Cursor.SetCursor(magnifierTexture, Vector2.zero, CursorMode.Auto);
}
void OnMouseExit()
{
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
}
}
Ever since I created the custom command, this script does nothing, even though this script is enabled in all interactive objects. I've also deleted every @fadeOut line and it won't work either
using Naninovel;
using Naninovel.Commands;
using UniRx.Async;
using UnityEngine;
[CommandAlias("fadeOut")]
public class FadeOutCommand : Command
{
Animator screenAnimator;
public override UniTask ExecuteAsync(CancellationToken cancellationToken = default)
{
screenAnimator = GameObject.Find("BlackScreen").GetComponent<Animator>();
screenAnimator.Play("FadeOut");
return UniTask.CompletedTask;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectInteraction : MonoBehaviour
{
public string scriptName;
public Texture2D magnifierTexture;
[HideInInspector] public GameObject pressedObject;
CameraMovement cameraScript;
delegate void ClickedAction();
event ClickedAction clickEvents;
void Start()
{
cameraScript = GameObject.Find("Main Camera").GetComponent<CameraMovement>();
clickEvents += DirectorScript.directorSingleton.DisableObjectInteraction;
clickEvents += cameraScript.SetDirection;
}
public void OnMouseDown()
{
cameraScript.pressedObject = gameObject;
DirectorScript.directorSingleton.scriptName = scriptName;
clickEvents();
}
void OnMouseEnter()
{
Cursor.SetCursor(magnifierTexture, Vector2.zero, CursorMode.Auto);
}
void OnMouseExit()
{
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
}
}
Ever since I created the custom command, this script does nothing, even though this script is enabled in all interactive objects. I've also deleted every @fadeOut line and it won't work either
EDIT: I used a backup this time and ObjectInteraction stops working the moment I put @fadeOut in any Nani script. Enabling or disabling ObjectInteraction doesn't work either, both in editor mode and play mode. I checked the assembly information of FadeOutCommand and it refers to Assembly-CSharp.dll, don't know if this means something
Assembly-CSharp is where your custom scripts code is compiled by default (if you're not using asmdefs). The issue is more about general Unity/C# stuff rather than Naninovel.
The first step is to isolate what exactly is not behaving as expected; then, in case it's Naninovel-related, feel free to ask here; otherwise, use Unity forum or other related resources.