コード例 #1
0
    void InitializeShieldColliders()
    {
        shieldScript   = GetComponentInChildren <ShieldScript>(true);
        adaptiveShield = GetComponentInChildren <AdaptiveShieldScript>(true);

        shieldScript.gameObject.SetActive(true);
        adaptiveShield.gameObject.SetActive(true);

        adaptiveShield.shieldOn = false;
        shieldScript.TurnOffShield();
    }
コード例 #2
0
    public void ToggleShield(bool shieldOn)
    {
        isShielding = shieldOn;
        if (isShielding)
        {
            shieldScript.TurnOnShield();
            PlaySound(shieldOnSound);
        }
        else
        {
            shieldScript.TurnOffShield();
            PlaySound(shieldOffSound);
        }

        adaptiveShield.shieldOn = isShielding;
    }