示例#1
0
    void ToggleState()
    {
        onState = !onState;

        triggerObj.GetComponent <ITrigger>().TriggerObj(onState);

        ToggleAnim(onState);

        audioSource.PlayerMovableBlockTriggerSounds("Button");
    }
示例#2
0
    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");
        }
    }