コード例 #1
0
 private void UpdateInput()
 {
     if (this.IsReady())
     {
         bool flag = !this.IsRevealed() && this.IsInputEnabled();
         if ((this.m_revealButton != null) && (UniversalInputManager.UsePhoneUI == null))
         {
             if (flag)
             {
                 this.m_revealButton.AddEventListener(UIEventType.ROLLOVER, new UIEvent.Handler(this.OnOver));
                 this.m_revealButton.AddEventListener(UIEventType.ROLLOUT, new UIEvent.Handler(this.OnOut));
                 this.m_revealButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnPress));
                 if (PegUI.Get().FindHitElement() == this.m_revealButton)
                 {
                     this.OnOver(null);
                 }
             }
             else
             {
                 this.m_revealButton.RemoveEventListener(UIEventType.ROLLOVER, new UIEvent.Handler(this.OnOver));
                 this.m_revealButton.RemoveEventListener(UIEventType.ROLLOUT, new UIEvent.Handler(this.OnOut));
                 this.m_revealButton.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnPress));
             }
         }
     }
 }
コード例 #2
0
 protected virtual void OnDestroy()
 {
     if (PegUI.Get() != null)
     {
         PegUI.Get().UnregisterCustomBehavior(this);
     }
 }
コード例 #3
0
 private void OnBoardCamerasLoaded(string name, GameObject go, object callbackData)
 {
     if (go == null)
     {
         UnityEngine.Debug.LogError(string.Format("Gameplay.OnBoardCamerasLoaded() - FAILED to load \"{0}\"", name));
     }
     else if (this.IsHandlingNetworkProblem())
     {
         UnityEngine.Object.Destroy(go);
     }
     else
     {
         go.transform.parent = Board.Get().transform;
         PegUI.Get().SetInputCamera(Camera.main);
         AssetLoader.Get().LoadActor("CardTypeBanner", false, false);
         AssetLoader.Get().LoadActor("BigCard", false, false);
     }
 }
コード例 #4
0
ファイル: Client.cs プロジェクト: wangfujia/HearthstoneBot
        public static void ClickLMB()
        {
            PegUI pegUI = PegUI.Get();

            if (pegUI != null)
            {
                pegUI.OnAppFocusChanged(true, Client.intptr_0);
            }
            Input.PressLMB();
            PegUI pegUI2 = PegUI.Get();

            if (pegUI2 != null)
            {
                pegUI2.OnAppFocusChanged(true, Client.intptr_0);
            }
            Input.ReleaseLMB();
            using (TritonHs.Memory.ReleaseFrame(true))
            {
                Thread.Sleep(Client.DelayAfterMouseClick);
            }
        }
コード例 #5
0
 private bool HandleSwipeGesture()
 {
     this.m_swipeRect = CameraUtils.CreateGUIScreenRect(Camera.main, (Component)this.m_upperLeftBone, (Component)this.m_lowerRightBone);
     if (UniversalInputManager.Get().GetMouseButtonDown(0) && this.InSwipeRect(UniversalInputManager.Get().GetMousePosition()))
     {
         this.m_checkingPossibleSwipe = true;
         this.m_swipeDetectTimer      = 0f;
         this.m_swipeStart            = UniversalInputManager.Get().GetMousePosition();
         this.m_swipeElement          = PegUI.Get().FindHitElement();
         return(true);
     }
     if (this.m_checkingPossibleSwipe)
     {
         this.m_swipeDetectTimer += UnityEngine.Time.deltaTime;
         if (UniversalInputManager.Get().GetMouseButtonUp(0))
         {
             this.m_checkingPossibleSwipe = false;
             if ((!this.CheckSwipe() && (this.m_swipeElement != null)) && (this.m_swipeElement == PegUI.Get().FindHitElement()))
             {
                 this.m_swipeElement.TriggerPress();
                 this.m_swipeElement.TriggerRelease();
             }
             return(true);
         }
         if (this.m_swipeDetectTimer < 0.1f)
         {
             return(true);
         }
         this.m_checkingPossibleSwipe = false;
         if (this.CheckSwipe())
         {
             return(true);
         }
         if (this.m_swipeElement != null)
         {
             PegUI.Get().DoMouseDown(this.m_swipeElement, this.m_swipeStart);
         }
     }
     return(false);
 }
コード例 #6
0
ファイル: Client.cs プロジェクト: wangfujia/HearthstoneBot
        private static void smethod_0(int int_0, int int_1, bool bool_0)
        {
            PegUI pegUI = PegUI.Get();

            if (pegUI != null)
            {
                pegUI.OnAppFocusChanged(true, Client.intptr_0);
            }
            Input.SetMousePos(int_0, int_1);
            using (TritonHs.Memory.ReleaseFrame(true))
            {
                Thread.Sleep(Client.DelayAfterMouseMove);
            }
            if (bool_0)
            {
                Client.ClickLMB();
                return;
            }
            using (TritonHs.Memory.ReleaseFrame(true))
            {
                Thread.Sleep(Client.DelayAfterMouseClick);
            }
        }
コード例 #7
0
    protected virtual void Awake()
    {
        s_instance = this;
        CollectionManager.Get().RegisterAchievesCompletedListener(new CollectionManager.DelOnAchievesCompleted(this.OnCollectionAchievesCompleted));
        AchieveManager.Get().TriggerLaunchDayEvent();
        AchieveManager.Get().UpdateActiveAchieves(new AchieveManager.ActiveAchievesUpdatedCallback(this.OnAchievesUpdated));
        this.m_hitbox.gameObject.SetActive(false);
        string key = "GLOBAL_CLICK_TO_CONTINUE";

        if (UniversalInputManager.Get().IsTouchMode())
        {
            key = "GLOBAL_CLICK_TO_CONTINUE_TOUCH";
        }
        this.m_continueText.Text = GameStrings.Get(key);
        this.m_continueText.gameObject.SetActive(false);
        PegUI.Get().SetInputCamera(CameraUtils.FindFirstByLayer(GameLayer.IgnoreFullScreenEffects));
        SceneUtils.SetLayer(this.m_hitbox.gameObject, GameLayer.IgnoreFullScreenEffects);
        SceneUtils.SetLayer(this.m_continueText.gameObject, GameLayer.IgnoreFullScreenEffects);
        if (!Network.ShouldBeConnectedToAurora())
        {
            this.UpdateRewards();
        }
    }
コード例 #8
0
 protected virtual void Awake()
 {
     PegUI.Get().RegisterCustomBehavior(this);
 }