예제 #1
0
    /// <summary>
    /// Allow power transfer and play sound.
    /// </summary>
    private void ProcessMinerals()
    {
        if (!IsFullyPowered)
        {
            // Now that the minerals have been destroyed, generate power from their disintegration.
            base.PowerOn();

            PowerSwitch powerSwitch = GetComponentInChildren <PowerSwitch>();

            if (powerSwitch != null)
            {
                powerSwitch.UnblockPowerSwitch();
            }

            myAudioSource = GetComponentInChildren <AudioSource>();

            if (myAudioSource != null)
            {
                myAudioSource.clip = onClip;
                myAudioSource.Play();
            }
        }

        // Get this annoying thing out of my face.
        arrow.SetActive(false);
    }