Exemple #1
0
    public void Setup(int _id, float _scale, float _speed, TextureHolder _bubbleTexture)
    {
        id                   = _id;
        speed                = _speed;
        bubbleTexture        = _bubbleTexture;
        transform.localScale = new Vector3(_scale, _scale, _scale);
        renderer.material.SetColor("_DiffuseColor", Color.white);
        int resolution = Mathf.FloorToInt((_scale * ConfigDictionary.Config.texturesResolutions.Length) / GameController.maxBubbleSize);

        resolution = Mathf.Clamp(resolution, 0, ConfigDictionary.Config.texturesResolutions.Length - 1);
        renderer.material.SetTexture("_Texture", bubbleTexture.GetTextureByResolution(ConfigDictionary.Config.texturesResolutions[resolution]));
    }