Example #1
0
 void OnRetryBtnClicked()
 {
     Time.timeScale = 1.0f;
     HJGameManager.Instance().CurrentGameState = HJGameState.eGamePlaying;
     HJGameEventHandler.Instance().TriggerRetrySameLevelEvent();
     HJPlayerScoreAndLevelManager.Instance().RestartCurrentLevel();
     mRetryScreen.SetActive(false);
 }
        private void OnCollisionEnter(Collision collision)
        {
            if (HJGameManager.Instance().CurrentGameState == HJGameState.eGamePlaying)
            {
                if (mIgnoreNextCollison)
                {
                    return;
                }

                HJSinglePlatformPiece slice = collision.gameObject.GetComponent <HJSinglePlatformPiece>();
                slice.CheckWhetherDeathOrGoal();
            }

            mBallRigidBody.velocity = Vector3.zero;
            mBallRigidBody.AddForce(Vector3.up * mImpulseForce, ForceMode.Impulse);
            mIgnoreNextCollison = true;
            Invoke("AllowNextCollision", 0.05f);
        }
        private void Update()
        {
            if (HJGameManager.Instance().CurrentGameState == HJGameState.eGamePlaying)
            {
                if (Input.GetMouseButton(0))
                {
                    Vector3 currentTapPos = Input.mousePosition;

                    if (mLastTapPosition == Vector3.zero)
                    {
                        mLastTapPosition = currentTapPos;
                    }
                    float xDelta = mLastTapPosition.x - currentTapPos.x;
                    mLastTapPosition = currentTapPos;

                    this.transform.Rotate(Vector3.up * xDelta);
                }
                if (Input.GetMouseButtonUp(0))
                {
                    mLastTapPosition = Vector3.zero;
                }
            }
        }
 public static HJGameManager Instance()
 {
     return(mInstance = mInstance == null ? new HJGameManager() : mInstance);
 }
Example #5
0
 void OnStartGameBtnClicked()
 {
     mGameStartUI.SetActive(false);
     mGamePlayUI.SetActive(true);
     HJGameManager.Instance().CurrentGameState = HJGameState.eGamePlaying;
 }
Example #6
0
 void OnStartGameBtnTappped()
 {
     gameObject.SetActive(false);
     mGamePlayUI.SetActive(true);
     HJGameManager.Instance().CurrentGameState = HJGameState.eGamePlaying;
 }
Example #7
0
 private void Awake()
 {
     mInstance = this;
 }
        //----------------------------------------------------------------------------------------------------

        void OnHitDeathSlice()
        {
            Debug.Log("Death sice hit ");
            HJGameManager.Instance().CurrentGameState = HJGameState.eGamePlayerDeath;
            HJGameEventHandler.Instance().TriggerOnPlayerDeathEvent();
        }