示例#1
0
 public void SetRadius(float radius)
 {
     /* Set radius in material property block */
     radius_ = radius;
     transform.localScale = new Vector3(radius_ * radius_correction_, height_, radius_ * radius_correction_);
     material_block_.SetRadius(radius);
 }
示例#2
0
    public void SetRadius(float radius)
    {
        /* Set radius in material property block */
        radius_ = radius;
        transform.localScale = new Vector3(radius_ * radius_correction_, height_, radius_ * radius_correction_);
        material_block_.SetRadius(radius);

        /* Set collision radius */
        float scaling = transform.localScale.x;

        GetComponent <CapsuleCollider>().radius = 1.7f * radius_ / scaling;
    }