| 12345678910111213141516171819 |
- using System;
- using UnityEngine;
- using UnityEngine.UI;
- namespace Fateforge
- {
- public sealed class CollectLever : MonoBehaviour
- {
- public RectTransform lever;
- public Image surface;
- public UiTheme theme;
- public void SetMachine(bool active)
- {
- if(lever && lever.gameObject.activeSelf)lever.gameObject.SetActive(false);
- if(surface&&theme){surface.sprite=active?theme.collectSprite:theme.primarySprite;surface.type=Image.Type.Sliced;surface.pixelsPerUnitMultiplier=1.9f;Ui.Stretch(surface.rectTransform);}
- var label=GetComponentInChildren<TMPro.TMP_Text>();if(label)Ui.Stretch(label.rectTransform,16,0,16,9);
- }
- }
- }
|