void Awake() { mTouchImg = transform.Find("position/bg/touch").GetComponent <Image>(); mShootBtn = transform.Find("shoot").GetComponent <SpButton>(); UIEventListener.Get(mShootBtn.gameObject).onDown += OnShootBtnDown; UIEventListener.Get(mShootBtn.gameObject).onUp += OnShootBtnUp; RectTransform rect = transform.Find("position/bg").GetComponent <RectTransform>(); mRadius = (int)((rect.rect.bottom - rect.rect.top) / 2); }
private SpButton CreateButton(IToolBarButton toolBarButton) { var button = new SpButton { Text = toolBarButton.Text, Size = btnLogout.Size }; button.ApplyTheme(_theme); button.Click += async(s, e) => await ToolBarCustomButtonClick(toolBarButton.Action); return(button); }
private SpButton CreateSubMenuItem(ITree <MenuCategory> arg) { var button = new SpButton { Text = arg.Value.Name, Tag = arg, Size = menuButtonSize, Font = new Font(Font.FontFamily, 10f) }; button.ApplyTheme(Theme); button.Click += SubMenuCategoryClick; return(button); }
private SpButton CreateMenuButon(ITree <MenuCategory> arg) { var button = new SpButton { Text = arg.Value.Name, Tag = arg, Size = new Size(100, flowTop.Height - 5), Selectable = true }; button.ApplyTheme(Theme); button.Click += MainCategoryClick; return(button); }
private SpButton CreateProductButton(Product arg) { var button = new SpButton { Text = arg.Name, Tag = arg, Size = menuButtonSize, Font = new Font(Font.FontFamily, 10f) }; button.ApplyTheme(Theme); button.BackColor = MaterialColors.BlueGray(); button.Click += ProductMenuClick; return(button); }