Пример #1
0
    private void UseBridge()
    {
        currentSlime.Crafted(AbilityType.Bridge);

        currentSlime.gameObject.tag   = untaggedTag;
        currentSlime.gameObject.layer = floorLayer;

        currentSlime.transform.localScale = new Vector3(
            currentSlime.transform.localScale.x * 1.5f,
            currentSlime.transform.localScale.y,
            currentSlime.transform.localScale.z
            );

        currentSlime.GetComponent <Slime>().enabled            = false;
        currentSlime.GetComponent <SlimeCheckGround>().enabled = false;

        currentSlime.GetComponent <CapsuleCollider2D>().enabled = false;
        currentSlime.GetComponent <PolygonCollider2D>().enabled = true;

        currentSlime.GetComponent <Rigidbody2D>().mass = 1f * 1000f;
    }