Esempio n. 1
0
 public void OnStatusButtonClick()
 {
     if (UIisShowing)
     {
         if (Status.transform.position.x == 0)
         {
             Status.GetComponent <TweenPosition>().PlayReverse();
             UIisShowing = false;
         }
         else
         {
             Inventroy.GetComponent <TweenPosition>().PlayReverse();
             Skill.GetComponent <TweenPosition>().PlayReverse();
             Equipment.GetComponent <TweenPosition>().PlayReverse();
             Setting.GetComponent <TweenPosition>().PlayReverse();
             QuestTween.PlayReverse();
             Status.GetComponent <TweenPosition>().PlayForward();
             DrugTween.PlayReverse();
             WeaponTween.PlayReverse();
             UIisShowing = true;
         }
     }
     else
     {
         Status.GetComponent <TweenPosition>().PlayForward();
         UIisShowing = true;
     }
 }
Esempio n. 2
0
    public void RestartGame()
    {
        ADS.HideAd();

        PanelTween_Gameplay_NonGameover.PlayReverse();

        shapes_TweenPos.PlayReverse();
        shapes_TweenScale.PlayReverse();
        score_TweenPos.PlayReverse();
        gameoverText_TweenPos.PlayReverse();
        twitterBtn_TweenPos.PlayReverse();

        score_TweenAlpha.PlayReverse();
        highscore_TweenAlpha.PlayReverse();

        PanelTween_Darklayer.PlayReverse();
        PanelTween_Gameover.PlayReverse();

        ClearGameoverShapeText();

        ResetTimer();

        currentDifficulty = 0;
        score             = 0;
        UpdateScore();

        StartGame();
    }
 public void OnAddRole(Role role)
 {
     //创建角色成功,返回角色信息
     playershowselectTween.PlayReverse();
     StartCoroutine(HidePanel(playershowselectTween.gameObject));
     playerselectTween.gameObject.SetActive(true);
     playerselectTween.PlayForward();
 }
 public void CheckClick()
 {
     if (Btn_Type == true)
     {
         Btn_Type = false;
         m_TweenPos.PlayReverse();
         MainCollider.enabled = false;
     }
 }
Esempio n. 5
0
    // Update is called once per frame
    void Update()
    {
        if (PlayerPrefs.HasKey("isPlayerPrefSet") && !resetSetting)
        {
            speedOxygenmeterPos.PlayReverse();
            TimerPos.PlayReverse();
            HeatMeterPos.PlayReverse();
            speedOxygenMeterScale.PlayReverse();
            TimerScale.PlayReverse();
            HeatMeterScale.PlayReverse();
            speedOxygenMeterColor.PlayReverse();
            TimerColor.PlayReverse();
            HeatMeterColor.PlayReverse();
            OverlayColor.enabled = false;
            OverlaySprite.color  = new Color(255f, 255f, 255f);
            iTween.StopByName("shaker");
            OverlayPos.delay = 3f;
            EventDelegate.Set(OverlayPos.onFinished, TweenStats);
            OverlayPos.PlayReverse();
        }

        if ((SpeedOmeter.valueCurrent >= zoomSpeed) && !(playedOnceForward) && Overlay.activeSelf)
        {
            speedOxygenmeterPos.PlayForward();
            TimerPos.PlayForward();
            HeatMeterPos.PlayForward();
            speedOxygenMeterScale.PlayForward();
            TimerScale.PlayForward();
            HeatMeterScale.PlayForward();
            speedOxygenMeterColor.PlayForward();
            TimerColor.PlayForward();
            HeatMeterColor.PlayForward();
            OverlayColor.enabled = true;
            iTween.ShakePosition(CameraObject, iTween.Hash("name", "shaker", "x", Shakingfactor, "y", Shakingfactor, "time", .1f, "looptype", "loop"));
            playedOnceForward = true;
            playedOnceReverse = false;
        }
        if ((SpeedOmeter.valueCurrent <= zoomSpeed) && playedOnceForward && !playedOnceReverse)
        {
            speedOxygenmeterPos.PlayReverse();
            TimerPos.PlayReverse();
            HeatMeterPos.PlayReverse();
            speedOxygenMeterScale.PlayReverse();
            TimerScale.PlayReverse();
            HeatMeterScale.PlayReverse();
            speedOxygenMeterColor.PlayReverse();
            TimerColor.PlayReverse();
            HeatMeterColor.PlayReverse();
            OverlayColor.enabled = false;
            OverlaySprite.color  = new Color(255f, 255f, 255f);
            iTween.StopByName("shaker");
            playedOnceForward = false;
            playedOnceReverse = true;
        }
    }
Esempio n. 6
0
 public void TransformState()
 {
     if (isShow == false)
     {
         tween.PlayForward();
         isShow = true;
     }
     else
     {
         tween.PlayReverse();
         isShow = false;
     }
 }
Esempio n. 7
0
 public void TransformState()
 {
     if (isShowing == false)
     {
         tween.PlayForward();
         isShowing = true;
         UpdateShow();
     }
     else
     {
         tween.PlayReverse();
         isShowing = false;
     }
 }
Esempio n. 8
0
 public void Show()
 {
     if (isShow == false)
     {
         isShow = true;
         this.gameObject.SetActive(true);
         tween.PlayForward();
     }
     else
     {
         tween.PlayReverse();
         isShow = false;
     }
 }
Esempio n. 9
0
    public void OnRegisterSubmittButtonClick()
    {
        for (int i = 0; i < inputs.Length; i++)
        {
            if (inputs[i].value == "")
            {
                PlayAnimation(i);
                return;
            }
        }



        //实现register逻辑
        accounts.Add(inputs[0].value, inputs[1].value);



        //跳转到登陆界面

        registerVIewTweenPosition.PlayReverse();
        loginViewTweenPosition.PlayReverse();


        /*if (nickNameInput.value == "")
         * {
         *  PlayAnimation(AnimationType.NICKNAME);
         *  isCanRegister = false;
         * }
         * if (ageInput.value == "")
         * {
         *  isCanRegister = false;
         *  PlayAnimation(AnimationType.AGE);
         * } else
         * {
         *  int intValue = int.Parse(ageInput.value);
         *  if (intValue < AgeInputLimit.minAge || intValue > AgeInputLimit.maxAge || ageInput == null)
         *  {
         *      PlayAnimation(AnimationType.AGE);
         *  }
         *
         * }
         */

        foreach (UIInput input in inputs)
        {
            input.value = "";
        }
    }
Esempio n. 10
0
 void ClickBet()
 {
     if (NowButton != ButtonStatus.Bet)
     {
         //如果其他按鈕有出現 進行互斥 並更新目前狀態
         if (NowButton != ButtonStatus.Idle)
         {
             StatusChange(NowButton);
         }
         NowButton = ButtonStatus.Bet;
         BetPosition.PlayForward();  //彈出設定欄位
         //圖片變押金(大)
         BetBackground.spriteName = "btn_moneyback_1";
         BetValue.depth           = BetBackground.depth - 1;
     }
     else
     {
         NowButton = ButtonStatus.Idle;
         BetPosition.PlayReverse();  //縮回設定欄位
         BetUpSprite.depth    = ButtonAreakground.depth - 1;
         BetDownSprite.depth  = ButtonAreakground.depth - 1;
         BetSetUp.isEnabled   = false; //關閉按鈕
         BetSetDown.isEnabled = false;
         BetSetMax.isEnabled  = false;
         //圖片變押金(小)+文字
         BetBackground.spriteName = "btn_moneyback_2";
         BetValue.depth           = BetBackground.depth + 1;
     }
 }
Esempio n. 11
0
 void ClickAuto()
 {
     if (NowButton != ButtonStatus.Auto)
     {
         //如果其他按鈕有出現 進行互斥 並更新目前狀態
         if (NowButton != ButtonStatus.Idle)
         {
             StatusChange(NowButton);
         }
         NowButton = ButtonStatus.Auto;
         //彈出設定欄位
         AutoPosition.PlayForward();
         if (IceAgeGameMain.Inst.GameStatus == IceAgeGameMain.Game_Status.FreeGame)
         {
             AutoUpButton.isEnabled       = false;
             AutoDownButton.isEnabled     = false;
             AutoInfinityButton.isEnabled = false;
         }
         else
         {
             AutoUpButton.isEnabled       = true;
             AutoDownButton.isEnabled     = true;
             AutoInfinityButton.isEnabled = true;
         }
         //圖片變自動(大)
         AutoBackground.spriteName = "btn_automatic_1";
         AutoValueLabel.enabled    = false;
     }
     else
     {
         NowButton = ButtonStatus.Idle;
         //縮回設定欄位
         AutoPosition.PlayReverse();
         AutoUpSprite.depth           = ButtonAreakground.depth - 1;
         AutoDownSprite.depth         = ButtonAreakground.depth - 1;
         AutoUpButton.isEnabled       = false;
         AutoDownButton.isEnabled     = false;
         AutoInfinityButton.isEnabled = false;
         if (AutoTimes == 0)
         {
             AutoBackground.spriteName = "btn_automatic_1";
             AutoValueLabel.enabled    = false;
         }
         else
         {
             //圖片變自動(小)+文字
             AutoBackground.spriteName = "btn_automatic_2";
             if (AutoTimes == 1000)
             {
                 AutoValueLabel.enabled = false;
                 AutoValueLabel.text    = "無限";
             }
             else
             {
                 AutoValueLabel.enabled = true;
                 AutoValueLabel.text    = AutoTimes + "";
             }
         }
     }
 }
Esempio n. 12
0
 public void PressExit()
 {
     IsPressExit = true;
     _Title_TweenPos.gameObject.SetActive(true);
     _Title_TweenPos.PlayReverse();
     _GameScene_TweenPos.PlayReverse();
 }
Esempio n. 13
0
 public void On_select_return_Click()
 {
     playerselectTween.PlayReverse();
     StartCoroutine(HidePanel(playerselectTween.gameObject));
     startpanelTween1.gameObject.SetActive(true);
     startpanelTween1.PlayReverse();
 }
Esempio n. 14
0
    public void OnCompleteSettingButtonClik()     //返回
    //返回界面  数组重新初始化

    {
        GameObject what = GameObject.Find("chessRENJI");

        what.transform.localPosition = new Vector3(8888, 8888, 0);
        board.start = true;
        startPanelTween.PlayReverse();
        optionPanelTween.PlayReverse();
        //ChessChongzhi chess = new ChessChongzhi ();
        for (int c = ChessChongzhi.Count; c > 1; c--)
        {
            chess.IloveHUIQI();
        }
        for (int i = 1; i <= 90; i++)
        {
            GameObject game  = GameObject.Find("item" + i.ToString());
            GameObject Clear = GameObject.Find("prefabs" + i.ToString());
            Destroy(game);
            Destroy(Clear);
        }
        what = GameObject.Find("Musiccup");
        Destroy(what);
    }
Esempio n. 15
0
 public void OnBtnClose()
 {
     tween.PlayReverse();
     buy1001.text = "1";
     buy1002.text = "1";
     buy1003.text = "1";
 }
    public void OnClickMenu( )
    {
        // Toggle the current menu buttons
        TweenPosition tp_return = _returnbutton.GetComponent <TweenPosition>( );
        TweenPosition tp_reset  = _resetbutton.GetComponent <TweenPosition>( );

        if (menu_active)
        {
            // Then hide the menu
            //tp_return.AddOnFinished( on_return_del );
            tp_return.PlayReverse( );

            //tp_reset.AddOnFinished( on_reset_del );
            tp_reset.PlayReverse( );
        }
        else
        {
            _returnbutton.SetActive(true);
            _resetbutton.SetActive(true);

            tp_return.PlayForward( );
            tp_reset.PlayForward( );
        }

        menu_active = !menu_active;
    }
Esempio n. 17
0
 void HideBtm()
 {
     MenuTPsB.duration = tpsDuration[1];
     MenuTAsB.duration = tasDuration[1];
     MenuTPsB.PlayReverse();
     MenuTAsB.PlayReverse();
 }
Esempio n. 18
0
    public void End()
    {
        GetComponent <Animator>().enabled = false;

        if (preselectedItem != null)
        {
            selectedItem = preselectedItem;
        }
        else
        {
            foreach (GameObject item in visibleQ)
            {
                if (Mathf.Abs(item.transform.localPosition.y) <= itemHeight / 2)
                {
                    selectedItem = item;
                    break;
                }
            }
        }

        //align
        if (NGUITools.GetActive(selectedItem) &&
            selectedItem.transform.localPosition.y < 0f &&
            selectedItem.transform.localPosition.y > -itemHeight / 2)
        {
            foreach (GameObject item in visibleQ)
            {
                TweenPosition tween = item.GetComponent <TweenPosition>();
                tween.PlayReverse();
            }
        }
        inAligning = true;
    }
Esempio n. 19
0
    void Update()
    {
        if (isTweenPositionComplete && !isVehicleCreated)
        {
            Vehicle.SetActive(true);
            isVehicleCreated = true;
            //UIRoot.SetActive (true);
            //Vehicle.SetActive (true);
            //Enable vehicle compnent one by one
        }

        if (isVehicleCreated && !isAllTweenComplete && isWaitComplete)
        {
            ps.Stop();
            tw.duration = 1f;
            tw.PlayReverse();
            isAllTweenComplete = true;
        }

        if (Vehicle.activeSelf && isAllTweenComplete && !isEverythingActivated)
        {
            Debug.Log("Vehicle is Active");
            Ship.GetComponent <PlayerMovement>().enabled = true;
            Ship.GetComponent <DeathndGoal>().enabled    = true;
            Overlay.SetActive(true);
            LevelStats.SetActive(true);
            InfoDisplayBox.SetActive(true);
            portableSettings.SetActive(true);
            Settings.SetActive(true);
            isEverythingActivated = true;
            colliderIdentifier.SetActive(true);
            //Destroy(this.gameObject);
            Debug.Log("All Set");
        }
    }
Esempio n. 20
0
    protected void UI_dir(bool Forward, bool hidden, GameObject go, ref TweenPosition TP, float duration, Vector3 TargetPos)
    {
        go.SetActive(true);

        if (Forward)
        {
            if (TP == null)
            {
                TP = TweenPosition.Begin(go, duration, TargetPos);
            }
            else
            {
                TP.PlayForward();
            }
            TP.delay = 0;
        }
        else
        {
            TP.PlayReverse();
            //結束後隱藏
            if (hidden)
            {
                EventDelegate eventDelegate = new EventDelegate(this, "hidden");

                eventDelegate.parameters [0] = new EventDelegate.Parameter(TP);

                EventDelegate.Add(TP.onFinished, eventDelegate, true);                 //oneshot=true
            }
        }
    }
Esempio n. 21
0
    private void updateHud()
    {
        //if (globals.isInGamePlay() == false) return;

        if (GameGlobals.Instance.controller.playerIsRunning == true && hudTimeEplased > hudScoreUpdateDelay)
        {
            hudTimeEplased = 0;
            increaseScore(1);
        }
        else
        {
            hudTimeEplased += Time.deltaTime;
        }

        // High Score ----
        if (scoresLock == false)
        {
            if (currentScore > (highScore - 450))
            {
                if (highScoreOpenPanelTrig == false)
                {
                    highScoreOpenPanelTrig = true;
                    if (highScoreHudPanel != null)
                    {
                        highScoreHudPanel.SetActive(true);
                    }
                    if (highScoreHudTween != null)
                    {
                        highScoreHudTween.PlayForward();
                    }
                }

                if (currentScore < highScore)
                {
                    lblHudHighScoreCountert.text = (highScore - currentScore).ToString();
                }
            }

            if (highScoreRecordedPanelTrig == false && currentScore > highScore)
            {
                highScoreRecordedPanelTrig = true;
                GameGlobals.Instance.audioController.playSound("PowerupLetterComplete", false);
                GameGlobals.Instance.isHighScoreRecorded = true;

                lblHudHighScoreCountert.text = "0";
                if (highScoreHudTween != null)
                {
                    highScoreHudTween.PlayReverse();
                }
            }
        }

        //----------------

        lblHudCoins.text = currentCoins.ToString();
        lblHudScore.text = currentScore.ToString();

        lblScorePanelCollectedCoins.text = currentCoins.ToString();
        lblScorePanelCollectedScore.text = currentScore.ToString();
    }
Esempio n. 22
0
 void Awake()
 {
     _instance = this;
     tween     = this.GetComponent <TweenPosition>();
     tween.PlayReverse();
     //this.gameObject.SetActive(false);
 }
Esempio n. 23
0
 void ClickInfo()
 {
     if (NowButton != ButtonStatus.Info)
     {
         //如果其他按鈕有出現 進行互斥 並更新目前狀態
         if (NowButton != ButtonStatus.Idle)
         {
             StatusChange(NowButton);
         }
         NowButton = ButtonStatus.Info;
         InfoPosition.PlayForward();  //彈出設定欄位
         //開啟Collider
         InfoPosition.transform.GetChild(1).GetComponent <BoxCollider>().enabled = true;
         InfoPosition.transform.GetChild(2).GetComponent <BoxCollider>().enabled = true;
         InfoPosition.transform.GetChild(3).GetComponent <BoxCollider>().enabled = true;
     }
     else
     {
         NowButton = ButtonStatus.Idle;
         InfoPosition.PlayReverse();  //縮回設定欄位
         //關閉Collider
         InfoPosition.transform.GetChild(1).GetComponent <BoxCollider>().enabled = false;
         InfoPosition.transform.GetChild(2).GetComponent <BoxCollider>().enabled = false;
         InfoPosition.transform.GetChild(3).GetComponent <BoxCollider>().enabled = false;
     }
 }
Esempio n. 24
0
    private void OnEvent_OnLoadSceneOver(IEvent ievent)
    {
        if (IsSceneType() == true)
        {
            MainUpUITween.gameObject.transform.localPosition     = MainUpUITween.to;
            FunctionUITween.gameObject.transform.localPosition   = FunctionUITween.from;
            FubenCloseUITween.gameObject.transform.localPosition = FubenCloseUITween.to;
            FunctionUITween.PlayReverse();
        }
        else
        {
            MainUpUITween.gameObject.transform.localPosition     = MainUpUITween.from;
            FunctionUITween.gameObject.transform.localPosition   = FunctionUITween.to;
            FubenCloseUITween.gameObject.transform.localPosition = FubenCloseUITween.to;
        }
        var scene = GameLogic.Instance.Scene;

        if (null != scene)
        {
            if (null != scene.TableScene)
            {
                if (1 == scene.TableScene.IsShowMainUI)
                {
                    ShowUpButton(false, true);
                }
                else
                {
                    ShowUpButton(false, true);
                }
            }
        }
    }
Esempio n. 25
0
    /// <summary> 上下往中 </summary>
    private void TopAndDownToSlide(PanelBase go, bool isTop, bool isOpen)
    {
        TweenPosition tp = go.gameObject.GetComponent <TweenPosition>();

        if (tp == null)
        {
            tp = go.gameObject.AddComponent <TweenPosition>();
        }
        //
        tp.from       = isTop == true ? new Vector3(0, 1000, 0) : new Vector3(0, -1000, 0);
        tp.to         = Vector3.zero;
        tp.duration   = go.OpenDuration;
        tp.ease       = Ease.InOutSine;
        tp.onFinished = () =>
        {
            if (isOpen)
            {
                go.OnShowed();
            }
            else
            {
                DestroyPanel(go.type);
            }
        };
        go.gameObject.SetActive(true);
        if (isOpen)
        {
            tp.Reset();
            tp.PlayForward();
        }
        else
        {
            tp.PlayReverse();
        }
    }
Esempio n. 26
0
        public override void Show(object data = null)
        {
            base.Show(data);

            iconImg.spriteName = ((TrophyData)data).iconID;

            TweenPosition tween = alertImg.gameObject.AddComponent <TweenPosition>();

            tween.to              = new Vector3(0, (Screen.height - alertImg.height) / 2, 0);
            tween.from            = alertImg.transform.localPosition;
            tween.steeperCurves   = true;
            tween.style           = UITweener.Style.Once;
            tween.delay           = 0f;
            tween.duration        = 0.5f;
            tween.ignoreTimeScale = false;
            EventDelegate.Add(tween.onFinished, () =>
            {
                EventDelegate.Add(tween.onFinished, () =>
                {
                    Action callback = data as Action;
                    if (callback != null)
                    {
                        callback();
                    }
                    LayerManager.GetInstance().RemovePopUpView(this);
                }, true);

                tween.delay = 2f;
                tween.PlayReverse();
            }, true);

            tween.PlayForward();
        }
Esempio n. 27
0
 /// <summary>
 /// signcharacter
 /// </summary>
 public void OnsigncharacterBackClick()
 {
     signCharacterPosTween.PlayReverse();
     StartCoroutine(HidePanel(signCharacterPosTween.gameObject));
     signPanelTween.gameObject.SetActive(true);
     signPanelTween.PlayForward();
 }
Esempio n. 28
0
    /*void Update()
     * {
     *  if (Input.GetKeyUp(KeyCode.A))
     *  {
     *      StartCoroutine("Play");
     *  }
     * }*/

    IEnumerator Play()
    {
        //yield return new WaitForEndOfFrame();

        FingerMove.PlayForward();
        FingerAlpha.PlayForward();

        EventDelegate del_2 = new EventDelegate(() =>
        {
            FingerMove.PlayReverse();
            FingerAlpha.PlayReverse();
        });

        EventDelegate del_1 = new EventDelegate(() =>
        {
            ArrowsMove.PlayForward();
            ArrowsMove.SetOnFinished(del_2);
        });

        FingerMove.SetOnFinished(del_1);

        yield return(new WaitForSeconds(2.0f));

        ArrowsMove.ResetToBeginning();
        //FingerMove.ResetToBeginning();
        //FingerAlpha.ResetToBeginning();

        FingerMove.RemoveOnFinished(del_1);
        ArrowsMove.RemoveOnFinished(del_2);
    }
Esempio n. 29
0
 void ClickInfo()
 {
     if (NowButton != ButtonStatus.Info)
     {
         //如果其他按鈕有出現 進行互斥 並更新目前狀態
         if (NowButton != ButtonStatus.Idle)
         {
             StatusChange(NowButton);
         }
         NowButton = ButtonStatus.Info;
         InfoPosition.PlayForward();  //彈出設定欄位
         //開啟Collider
         m_InstructionsCollider.enabled  = true;
         m_RecentHundredCollider.enabled = true;
         m_LotteryRecordCollider.enabled = true;
     }
     else
     {
         NowButton = ButtonStatus.Idle;
         InfoPosition.PlayReverse();  //縮回設定欄位
         //關閉Collider
         m_InstructionsCollider.enabled  = false;
         m_RecentHundredCollider.enabled = false;
         m_LotteryRecordCollider.enabled = false;
     }
 }
Esempio n. 30
0
 /// <summary>
 /// change player panel btn close
 /// </summary>
 public void OnChangePlayerCloseClick()
 {
     ChangePlayerTweenPos.PlayReverse();
     StartCoroutine(HidePanel(ChangePlayerTweenPos.gameObject));
     SelectPlayerTweenPos.gameObject.SetActive(true);
     SelectPlayerTweenPos.PlayForward();
 }