예제 #1
0
    /// <summary>
    /// Sets whether the move is a block move or not.
    /// </summary>
    /// <param name="blockMove">If set to <c>true</c> move is a block.</param>
    public void SetBlockMove(bool blockMove)
    {
        this.move.SetBlockMove(blockMove);
        activeBodypartSelector.SetBlockMove(blockMove);
        if (blockMove)
        {
            //Change gui labels to match move type.
            sliders.SetSliderStrings("Coverage", "Block");
        }
        else
        {
            //Change gui labels to match move type.
            sliders.SetSliderStrings("Strength", "Speed");
        }

        string activeBodyPartName = move.GetActiveBodypart();

        if (activeBodyPartName != null)
        {
            GameObject activeBodyPart = GameObject.Find(move.GetActiveBodypart());
            if (activeBodyPart != null)
            {
                activeBodyPart.GetComponent <ColorModifier> ().SetSelected(!blockMove);
            }
            GameObject shield = GameObject.Find(move.GetActiveBodypart().Replace(" ", "") + "Shield");
            shield.GetComponent <SpriteRenderer> ().enabled = blockMove;
        }
        UpdateShieldScale();
    }