edited December 2014 in ORK Scripting
Thanks for the great work , I just try , But Meet with difficulties,
1. How to change combatant name there isn't in activeGroup,
I saw have a setCombatant event setp,But this method only can change the active play and combatant that passed by ator,
CombatantsSettings combatantsSettings= ORK.Combatants ;
CombatantSetting combatantSetting = combatantsSettings.Get(0);
combatantSetting.GetContent().text="New Name";
string name = combatantSetting.GetName();

// But the name is old name ,

2. How to stop the music and audio by script ?
I try below code,
ORK.Audio .volume=0;

but can not stop audio that from event PlaySoundStep , I want stop all music and audio.

3. When I add some info to ORK at run time by my script code , Can I save the ORK info to file at play time, like save full ORKProject.asset file at runtime?
Item item= ORK.Items.Get( ORK.Items.Add());

4. Can I call an event step from my script code. I just know call a global event via script code.

5. I define some "Scene Objects" items in editor, Where or when to use these items, and how to use ?

Post edited by gamingislove on
  • I'm curious about how to do this in script too if you wanted to--to stop the music and audio. : )

  • edited December 2014
    Moved to scripting.

    Stopping music:


    Or fading it out (e.g. linear for 1 second):

    ORK.Music.FadeOut(1, EaseType.Linear);

    Stopping the playing sound is a bit more complex, as you'll need to get the object that is playing the sound. The sound is played using Unity's standard audio component AudioSource, which also has a stop function. If you want to stop all sounds, it's probably best to search for all audio sources in the scene and stop them all, e.g.:

    AudioSource[] audio = GameObject.FindObjectsOfType<AudioSource>();

    Now you only need to go through the audio source array and call the Stop function on all of them.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.