コード例 #1
0
        public bool HandleTouchUp(Vector3 screenPos)
        {
            if (!isTapOnUI)
            {
                var touched = Utils.GetInputTargetOnGrid(screenPos, sceneSystem, cameraService.activeCamera, gridService);
                if (touched != null && (!touched.hasGrid || (touched.hasGrid && touched.grid.cells.Count > 0)))
                {
                    EventDispatcherService <GameEntity> .Dispatch(Constants.EVENT_ENTITY_TAP_UP, touched);

                    if (touched.hasGameObject)
                    {
                        TutorialService <TutorialStep> .Notify(string.Format("tap?{0}", touched.objectId));
                    }

                    if (touched.hasCommand && !string.IsNullOrEmpty(touched.command.onTapCommand))
                    {
                        var cell = touched.hasGrid ? touched.grid.pivot : null;
                        commandSystem.Execute(touched.command.onTapCommand, touched.position, cell, touched);
                        AnimateObjectTouch(touched);
                    }
                }
            }
            isTapOnUI = false;
            return(false);
        }
コード例 #2
0
        protected virtual void ExecuteHeadCommand(CommandData commandData, Vector3 executePos, GameEntity cell, GameEntity trigger = null)
        {
            if (commandData.destroyTrigger && trigger != null)
            {
                if (trigger.hasCommand)
                {
                    commandSystem.Execute(trigger.command.onDestroyCommand, executePos, cell, trigger);
                }

                gridService.DeAttach(trigger);

                trigger.Destroy();
            }

            if (!string.IsNullOrEmpty(commandData.tutorialTrigger))
            {
                TutorialService <TutorialStep> .Notify(commandData.tutorialTrigger);
            }
        }
コード例 #3
0
 protected override void Start()
 {
     base.Start();
     component.onClick.AddListener(() => TutorialService <TutorialStep> .Notify("move_next"));
 }