Example #1
0
 public override void _Start()
 {
     base._Start();
     cc   = TransTool.GetComScene <CharCtrl>();
     grid = GetComponentInChildren <UIGrid>(true);
     grid.Initialize();
     grid.onClick = SkillAction;
     this.AddInput(_Input, -1, false);
 }
Example #2
0
    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);
        }
    }
Example #3
0
File: UIBlock.cs Project: wjk17/WSA
 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);
 }