Exemple #1
0
    // used when attaching to a controllable block if one is below us
    bool AttachToBlock(Collider2D potential_controllable)
    {
        controlled_block = potential_controllable.gameObject.GetComponent <Controllable>();
        // check if someone is already in the weapon
        if (controlled_block.IsOccupied() || PhaseManager.S.gameOver)
        {
            return(false);
        }

        controlled_block.AttachUser(this);
        rigid.velocity = Vector3.zero;
        form           = PlayerForm.Controlling;

        // JF: Disable tooltip
        controlled_block.image.enabled = false;

        // successfully attached!
        return(true);
    }