Forum rules - please read before posting.

How to gather text from custom script

Hi everybody,
AC 1.82.5 and Unity LTS 2022.3.3f1 in 2d.

I don't know how to gather text defined within some "action list assets" and referenced by a custom action. Looking at the SpeechManager script, I see that there is a method called GetActionListAssetsFromActions, which allows for something similar, but in this version, it doesn't seem possible to add code for custom actions.

Is there another way to perform the gather?

Thank you.

Comments

  • Create a C# script that implements iActionListAssetReferencer and use it to reference your assets.

    Example script:

    using UnityEngine;
    using System.Collections.Generic;
    using AC;
    
    public class ReferencerExample : MonoBehaviour, iActionListAssetReferencer
    {
    
    
        #if UNITY_EDITOR
    
        public List<ActionListAsset> actionLists;
        public bool ReferencesAsset (ActionListAsset actionListAsset) => actionLists.Contains (actionListAsset);
        public List<ActionListAsset> GetReferencedActionListAssets () => actionLists;
    
        #endif
    
    }
    
  • Thank you Chris, it works great.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.