Ejemplo n.º 1
0
 void UpdateSlot(Image2 image)
 {
     if (image != null)
     {
         image.color = ComputeColor(spriteSlot.color);
     }
 }
Ejemplo n.º 2
0
    private void UpdateSpriteSize(Vector2 originPosition, Image2 image, Rect spriteRect) {
        float posX = originPosition.x * scaleRatio.x;
        float posY = originPosition.y * scaleRatio.y;

        MadTransform.SetLocalPosition(image.rectTransform, new Vector3(posX, posY));
        SetSize(image.rectTransform, new Vector2(spriteRect.width * scaleRatio.x, spriteRect.height * scaleRatio.y));
    }
Ejemplo n.º 3
0
 void SetIconVisible(Image2 image, float scale = 1)
 {
     image.color     = ComputeColor(spriteIcon.color);
     image.fillValue = 1;
     MadTransform.SetLocalScale(image.transform, new Vector3(scale, scale, scale));
     image.enabled = true;
 }
Ejemplo n.º 4
0
 private void BuildBar() {
     imageBar = CreateChild<Image2>("bar");
     imageBar.sprite = spriteBar;
     imageBar.material = spriteBarMaterial;
     imageBar.SetNativeSize();
     imageBar.growDirection = growDirection;
     imageBar.readable = true;
     imageBar.uvTiling = barImageRepeater;   // Cipsoft change
 }
Ejemplo n.º 5
0
    private void BuildEffectTilled() {
        effectTilledImageBarMask = CreateChild<Image2>("bar_mask");
        effectTilledImageBarMask.sprite = spriteBar;
        effectTilledImageBarMask.SetNativeSize();
        effectTilledImageBarMask.growDirection = growDirection;
        effectTilledImageBarMask.readable = true;

        var mask = effectTilledImageBarMask.gameObject.AddComponent<Mask>();
        mask.showMaskGraphic = false;

        effectTilledImageTiles = CreateChild<Image2>("tiles", effectTilledImageBarMask.transform);
        effectTilledImageTiles.sprite = effectTiledSprite;
    }
Ejemplo n.º 6
0
    private void BuildBurnBar() {
        imageBurn = CreateChild<Image2>("burn_bar");

        if (effectBurnSprite.sprite) {
            imageBurn.sprite = effectBurnSprite.sprite;
        } else {
            imageBurn.sprite = spriteBar;
        }

        imageBurn.material = effectBurnSprite.material;
        imageBurn.SetNativeSize();
        imageBurn.growDirection = growDirection;
        imageBurn.uvTiling = barImageRepeater;    // Cipsoft change
    }
Ejemplo n.º 7
0
    private void BuildEffectTilled() {
        effectTilledImageBarMask = CreateChild<Image2>("bar_mask");
        effectTilledImageBarMask.sprite = spriteBar;
        effectTilledImageBarMask.SetNativeSize();
        effectTilledImageBarMask.growDirection = growDirection;
        effectTilledImageBarMask.readable = true;

        var mask = effectTilledImageBarMask.gameObject.AddComponent<Mask>();
        mask.showMaskGraphic = false;

        effectTilledImageTiles = CreateChild<Image2>("tiles", effectTilledImageBarMask.transform);
        effectTilledImageTiles.sprite = effectTiledSprite;
    }
Ejemplo n.º 8
0
 private void BuildBar() {
     imageBar = CreateChild<Image2>("bar");
     imageBar.sprite = spriteBar;
     imageBar.SetNativeSize();
     imageBar.growDirection = growDirection;
     imageBar.readable = true;
 }
Ejemplo n.º 9
0
 private void BuildBurnBar() {
     imageBurn = CreateChild<Image2>("burn_bar");
     imageBurn.sprite = imageBurn.sprite ?? spriteBar;
     imageBurn.SetNativeSize();
     imageBurn.growDirection = growDirection;
 }
Ejemplo n.º 10
0
 void SetIconInvisible(Image2 image) {
     image.enabled = false;
 }
Ejemplo n.º 11
0
 void UpdateSlot(Image2 image) {
     if (image != null) {
         image.color = ComputeColor(spriteSlot.color);
     }
 }
Ejemplo n.º 12
0
 void SetIconVisible(Image2 image, float scale = 1) {
     image.color = ComputeColor(spriteIcon.color);
     image.fillValue = 1;
     MadTransform.SetLocalScale(image.transform, new Vector3(scale, scale, scale));
     image.enabled = true;
 }
Ejemplo n.º 13
0
 private void BuildBar()
 {
     barImage = CreateChild<Image2>("bar");
 }
Ejemplo n.º 14
0
 private void BuildBurnBar()
 {
     imageBurn = CreateChild<Image2>("burn_bar");
     imageBurn.sprite = imageBurn.sprite ?? spriteBar;
     imageBurn.SetNativeSize();
     imageBurn.growDirection = growDirection;
     imageBurn.uvTiling = barImageRepeater;    // Cipsoft change
 }
Ejemplo n.º 15
0
 private void BuildBar()
 {
     imageBar = CreateChild<Image2>("bar");
     imageBar.sprite = spriteBar;
     imageBar.SetNativeSize();
     imageBar.growDirection = growDirection;
     imageBar.readable = true;
     imageBar.uvTiling = barImageRepeater;   // Cipsoft change
 }
Ejemplo n.º 16
0
 private void BuildBar() {
     barImage = CreateChild<Image2>("bar");
 }
Ejemplo n.º 17
0
 void SetIconInvisible(Image2 image) {
     image.enabled = false;
 }
Ejemplo n.º 18
0
    private void UpdateSpriteSize(Vector2 originPosition, Image2 image, Rect spriteRect) {
        float posX = originPosition.x * scaleRatio.x;
        float posY = originPosition.y * scaleRatio.y;

        MadTransform.SetLocalPosition(image.rectTransform, new Vector3(posX, posY));
        SetSize(image.rectTransform, new Vector2(spriteRect.width * scaleRatio.x, spriteRect.height * scaleRatio.y));
    }