void ToggleState() { onState = !onState; triggerObj.GetComponent <ITrigger>().TriggerObj(onState); ToggleAnim(onState); audioSource.PlayerMovableBlockTriggerSounds("Button"); }
void InitCurrMovingBlockVars() { startTime = Time.time; if (onOff) { startBlockPos = blocks[currBlockIndex].obj.transform.position; endBlockPos = blocks[currBlockIndex].positions.GetChild(1).position; } else { startBlockPos = blocks[currBlockIndex].obj.transform.position; endBlockPos = blocks[currBlockIndex].positions.GetChild(0).position; } journeyLength = Vector3.Distance(startBlockPos, endBlockPos); if (audioSource != null) { audioSource.PlayerMovableBlockTriggerSounds("Moving Block Trigger"); } }