コード例 #1
0
 void UpdateSlot(Image2 image)
 {
     if (image != null)
     {
         image.color = ComputeColor(spriteSlot.color);
     }
 }
コード例 #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));
    }
コード例 #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;
 }
コード例 #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
 }
コード例 #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;
    }
コード例 #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
    }
コード例 #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;
    }
コード例 #8
0
 private void BuildBar() {
     imageBar = CreateChild<Image2>("bar");
     imageBar.sprite = spriteBar;
     imageBar.SetNativeSize();
     imageBar.growDirection = growDirection;
     imageBar.readable = true;
 }
コード例 #9
0
 private void BuildBurnBar() {
     imageBurn = CreateChild<Image2>("burn_bar");
     imageBurn.sprite = imageBurn.sprite ?? spriteBar;
     imageBurn.SetNativeSize();
     imageBurn.growDirection = growDirection;
 }
コード例 #10
0
 void SetIconInvisible(Image2 image) {
     image.enabled = false;
 }
コード例 #11
0
 void UpdateSlot(Image2 image) {
     if (image != null) {
         image.color = ComputeColor(spriteSlot.color);
     }
 }
コード例 #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;
 }
コード例 #13
0
 private void BuildBar()
 {
     barImage = CreateChild<Image2>("bar");
 }
コード例 #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
 }
コード例 #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
 }
コード例 #16
0
 private void BuildBar() {
     barImage = CreateChild<Image2>("bar");
 }
コード例 #17
0
 void SetIconInvisible(Image2 image) {
     image.enabled = false;
 }
コード例 #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));
    }