// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // //! コマンド処理 public void CommandProcess(ICommand command) { Type commandType = command.GetType(); if (commandType == typeof(ButtonCommand)) { ButtonCommand buttonCommand = (ButtonCommand)command; ButtonCommandProcess(buttonCommand); } else { ArkLog.Error("処理を定義してないコマンドが来た"); } }
private bool isPressing = false; // 長押し中か? #endregion // Use this for initialization void Start() { // GameMainObjectの取得 GameObject go = GameObject.FindWithTag("MainGameObject"); MainGameObject mainGameObject = go.GetComponent <MainGameObject>(); IBaseSceneView_ForUIEventRegister sceneView = mainGameObject.GetCurrentSceneView(); // Buttonにイベントセット button = this.GetComponent <Button>(); if (isChangeButtonScale) { startButtonScale = button.transform.localScale; } else { startButtonScale = Vector3.one; } if (button != null) { if (isLongTapButton) { // 特になし onLongPress = () => { //gameMainObject.OnUILongTapEvent(eUIAction.UILongTapEvent, this.gameObject); }; } // タップボタン機能 button.onClick.RemoveAllListeners(); button.onClick.AddListener( () => { isPushed = true; if (!underLock) { AutoLock(BUTTON_LOCK_SEC); ICommand command = new ButtonCommand(_buttonId, EButtonTouchKind.Tap); sceneView.NotifyCommand(command); } } ); isPushed = false; } }