Can I write a custom group ?

Slate Forums Support Can I write a custom group ?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1091
    jakin
    Participant

    I want to write a custom group for some reason
    But I find track need add “[Attachable(typeof(XXXXX))]” AttachableAttribute

    If I write a new group<class MyGroup : CutsceneGroup {}>, I need to add [Attachable(typeof(MyGroup)] for all tracks ???

    #1095
    Gavalakis
    Keymaster

    Hey,

    Each track needs to know in which type of group it is allowed to be added. (Thus an Animator Track can’t be added on the global, Director group).
    If you are also going to create custom tracks, you can of course create a base track class and only add the attribute in the base class.
    If the group is supposed to use the existing tracks like for example ActorActionTrack, then you will need to add the attribute to the ActorActionTrack as well, even though this means that the original source code needs to be changed which is not advisable easier updating.

    To be honest Groups were never really meant to be expanded, but rather only tracks and action clips.

    May I ask the reason for a custom Group? Is it something that could be implemented officially?

    Let me know.
    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

    #1153
    jakin
    Participant

    I want the group actor is A or B or C, so I need to craete actor by some define ID instead of using prefab for my work

    It like this
    void OnStart()
    {
    if (ID == 1) actor = GameObject.Instantiate(A_Prefab);
    else if (ID == 2) actor = GameObject.Instantiate(B_Prefab);
    else if (ID == 3) actor = GameObject.Instantiate(C_Prefab);
    }

    #1156
    Gavalakis
    Keymaster

    Hello again,

    Instead of creating a custom group, you can dynamically change the target actor through code and in runtime, before starting the cutscene.
    You just have to give the Actor Group a name in the inspector and then in code call cutscene.SetGroupActorOfName(“MyActor”, newActor);
    For example:

    Let me know if that works for you.
    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.