void Update() { if (GlobalParam.GetInstance().IsAdvertiseMode() && Input.GetMouseButtonDown(0)) { UnityEngine.SceneManagement.SceneManager.LoadScene("TitleScene"); } }
public void OnGrid(Vector3 newPos) { // 보석을 줍는다. m_map.PickUpItem(newPos); Vector3 direction; if (GlobalParam.GetInstance().IsAdvertiseMode()) { direction = GetAdvModeMoveDirection(); } else { direction = GetMoveDirection(); } // 키 입력 없음(방향 전환 하지 않는다). if (direction == Vector3.zero) { return; } // 키 입력 방향으로 이동(이동할 수 있는 경우). if (!m_grid_move.CheckWall(direction)) { m_grid_move.SetDirection(direction); } }
void Start() { switch (GlobalParam.GetInstance().difficulty()) { case 0: { this.level = LEVEL.EASY; } break; case 1: { this.level = LEVEL.NORMAL; } break; case 2: { this.level = LEVEL.HARD; } break; default: { this.level = LEVEL.EASY; } break; } }
public void OnPlayButtonPressed() { m_PlayButtonPushed = true; GetComponent <AudioSource>().Play(); GlobalParam.GetInstance().SetMode(false); StartCoroutine(StartGame()); }
void Update() { if (this.pressed_button != "") { switch (this.pressed_button) { case "easy": { GlobalParam.GetInstance().SetMode(0); UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene"); } break; case "normal": { GlobalParam.GetInstance().SetMode(1); UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene"); } break; case "hard": { GlobalParam.GetInstance().SetMode(2); UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene"); } break; default: break; } } }
public void OnGrid(Vector3 newPos) { // 捡起宝石 m_map.PickUpItem(newPos); Vector3 direction; if (GlobalParam.GetInstance().IsAdvertiseMode()) { direction = GetAdvModeMoveDirection(); } else { direction = GetMoveDirection(); } // 没有按键输入(不转换方向) if (direction == Vector3.zero) { return; } // 先按键输入的方向移动(允许移动的情况下) if (!m_grid_move.CheckWall(direction)) { m_grid_move.SetDirection(direction); } }
public void OnGrid(Vector3 newPos) { // 宝石を拾う. m_map.PickUpItem(newPos); Vector3 direction; if (GlobalParam.GetInstance().IsAdvertiseMode()) { direction = GetAdvModeMoveDirection(); } else { direction = GetMoveDirection(); } // キー入力なし(方向転換しない). if (direction == Vector3.zero) { return; } // キー入力の方向へ移動(移動できる場合). if (!m_grid_move.CheckWall(direction)) { m_grid_move.SetDirection(direction); } }
// Update is called once per frame void Update() { m_go_adv -= Time.deltaTime; if (m_go_adv < 0.0f && !m_PlayButtonPushed) { GlobalParam.GetInstance().SetMode(true); UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene"); } }
void Start() { // 获取hi-score的实例 textHiScore = GetComponent <GUIText>(); // 从GlobalParam中获取hi-score hiScore = GlobalParam.GetInstance().GetHiScore(); // 显示初始值 textHiScore.text = hiScore.ToString(); }
void Start() { // hi-scoreのインスタンスを取得. textHiScore = GetComponent <GUIText>(); // グローバルパラメーターからhi-scoreを取得. hiScore = GlobalParam.GetInstance().GetHiScore(); // 初期値表示. textHiScore.text = hiScore.ToString(); }
public void PlayerIsDead() { if (GlobalParam.GetInstance().IsAdvertiseMode()) { UnityEngine.SceneManagement.SceneManager.LoadScene("TitleScene"); } else { Retry(); } }
// ------------------------------------------------------------------------ // 如果SCORE超过了HISCORE则存储 // ------------------------------------------------------------------------ private bool SetHiscore() { // 获取SCORE/HISCORE int hiScore = Navi.get().GetHiScore(); int score = Navi.get().GetScore(); // 判断是否超过HISCORE? if (score > hiScore) { // 更新得分记录 Navi.get().SetHiScore(score); // 存储在GlobalParam区域中 GlobalParam.GetInstance().SetHiScore(score); return(true); } return(false); }
// ================================================================ // // MonoBehaviour 부터 상속. void Start() { m_gameCtrl = GameObject.Find("GameCtrl").GetComponent <GameCtrl>(); OnGameStart(); GlobalParam param = GlobalParam.GetInstance(); if (param != null) { if (param.IsAdvertiseMode()) { m_uiDemoText.gameObject.SetActive(true); } else { m_uiDemoText.gameObject.SetActive(false); } } }
// ------------------------------------------------------------------------ // HISCOREを保持する. // ------------------------------------------------------------------------ private bool SetHiscore() { // SCORE/HISCOREを取得. int hiScore = Navi.get().GetHiScore(); int score = Navi.get().GetScore(); // HISCOREを超えたか? if (score > hiScore) { // ハイスコア更新. Navi.get().SetHiScore(score); // グローバル領域に保存する. GlobalParam.GetInstance().SetHiScore(score); return(true); } return(false); }
// ------------------------------------------------------------------------ // 存储HISCORE // ------------------------------------------------------------------------ private bool SetHiscore() { // 获取SCORE/HISCORE int hiScore = Navi.get().GetHiScore(); int score = Navi.get().GetScore(); // 是否超过了HISCORE? if (score > hiScore) { // 更新最高得分 Navi.get().SetHiScore(score); // 保存到GlobalParam GlobalParam.GetInstance().SetHiScore(score); return(true); } return(false); }
void Start() { // 从全局参数中获取hi-score this.SetHiScore(GlobalParam.GetInstance().GetHiScore()); }
void Start() { // グローバルパラメーターからhi-scoreを取得. this.SetHiScore(GlobalParam.GetInstance().GetHiScore()); }