Page 1 of 1
Shortcuts
Posted: Sat Oct 30, 2021 12:41 pm
by SealDev
I use CinemachinePriority very often but it takes a while to type or switch to a different conversation when I don't have another node to copy the text from.
Is there a way to write a much shorter word to replace just that text, and will the sequencer command still work?
Example:
CinemachinePriority(Cam,1)
Cam(Cam,1)
Re: Shortcuts
Posted: Sat Oct 30, 2021 2:33 pm
by Tony Li
Re: Shortcuts
Posted: Tue Aug 23, 2022 8:33 am
by SealDev
Those are nice, but what if I have many cameras and I need just a very general shortcut which is very quick to type?
For example CinemachinePriority() vs C(), which would allow me to fill in the same parameters and trigger the original function. Existing shortcuts only work very specifically with 1 single camera, set to 1 specific priority.
Can I create my own shortcut as a pointer to the cinemachinepriority? I think this feature would be cool, especially when you use a command thousands of times.
Copy pasting from other nodes/conversations is way slower by comparison.
Re: Shortcuts
Posted: Tue Aug 23, 2022 8:41 am
by Tony Li
Hi,
Create a new sequencer command that's just an "alias" for the original command. Such as:
SequencerCommandC.cs
Code: Select all
using UnityEngine;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandC : SequencerCommandCinemachinePriority {}
}
Then you can use C(), and it will be just like using CinemachinePriority().
Re: Shortcuts
Posted: Tue Aug 23, 2022 9:18 am
by SealDev
Thank you so much!
By the way, "except:" parameter does the same thing as "all:" for the cinemachinepriority command. How can I fix it?
Is SendMessage() not publicly exposed? How can create an alias shortcut for it as well?
Re: Shortcuts
Posted: Tue Aug 23, 2022 10:48 am
by Tony Li
For performance, most of the built-in sequencer commands that are able to run immediately, such as SendMessage(), are internally defined and not subclassable. But you can write your own version if you like. Duplicate SequencerCommandTemplate.cs, rename it to SequencerCommandSM.cs, and fill in the code to find the subject and send the the message.