public override void _Start() { base._Start(); cc = TransTool.GetComScene <CharCtrl>(); grid = GetComponentInChildren <UIGrid>(true); grid.Initialize(); grid.onClick = SkillAction; this.AddInput(_Input, -1, false); }
void Start() { var btns = TransTool.GetComsScene <UnityEngine.UI.Button>(); foreach (var btn in btns) { btn.onClick.AddListener(() => PlaySound("Click")); } src = GetComponents <AudioSource>(); if (playOnAwake) { PlayBGM(clipName); } }
public void BlockUI(bool block) { foreach (var mouse in TransTool.GetComsScene <MouseEventWrapper>()) { mouse.enabled = !block; } foreach (var grid in TransTool.GetComsScene <UIGrid>()) { grid.enabled = !block; } foreach (var row in TransTool.GetComsScene <Button_Row>()) { row.enabled = !block; } foreach (var button in TransTool.GetComsScene <Button>()) { if (button != this.GetComChild <Button>()) { button.enabled = !block; } } gameObject.SetActive(block); }