Created
September 7, 2019 21:39
-
-
Save mcu8/c8e5044268da872bc6bd616e2d3acdf5 to your computer and use it in GitHub Desktop.
Change MusicTree Volume/Pitch multiplers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class mcu8_SeqAct_MusicTreeVolumePitchMltp extends SequenceAction; | |
var float MultiplerVolume; | |
var float MultiplerPitch; | |
defaultproperties | |
{ | |
ObjName="Change MusicTree Volume/Pitch multiplers" | |
ObjCategory="Sound" | |
InputLinks(0)=(LinkDesc="Change Volume Mult.") | |
InputLinks(1)=(LinkDesc="Change Pitch Mult.") | |
InputLinks(2)=(LinkDesc="Change Both Mult.") | |
MultiplerVolume = 0 | |
MultiplerPitch = 0 | |
VariableLinks.Empty | |
VariableLinks(1)=(ExpectedType=class'SeqVar_Float',LinkDesc="Volume multipler",bWriteable=true,PropertyName=MultiplerVolume) | |
VariableLinks(2)=(ExpectedType=class'SeqVar_Float',LinkDesc="Pitch multipler",bWriteable=true,PropertyName=MultiplerPitch) | |
EventLinks.Empty | |
bCallHandler=false | |
} | |
event Activated() | |
{ | |
local Hat_MusicManager mm; | |
local Hat_PlayerController pc; | |
pc = Hat_PlayerController(class'Engine'.static.GetEngine().GamePlayers[0].Actor); | |
if (pc == None) return; | |
mm = pc.GetMusicManager(); | |
if (mm == None) return; | |
if (mm.MusicTreeInstance == None) return; | |
if (InputLinks[0].bHasImpulse || InputLinks[2].bHasImpulse) | |
mm.MusicTreeInstance.VolumeMultiplier = MultiplerVolume; | |
if (InputLinks[1].bHasImpulse || InputLinks[2].bHasImpulse) | |
mm.MusicTreeInstance.PitchMultiplier = MultiplerPitch; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment