// クリック開始処理 public void OnDragStart() { // クリックした位置のオブジェクトを取得 RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero); if (hit.collider != null) { // ピースの状態が何もなければ if (hit.transform.GetComponent <PuzzlePiece>().GetState() == DEFINE.PUZZLE_PIECE_STATE.NONE) { GameObject hitObj = hit.collider.gameObject; //オブジェクトの名前を前方一致で判定 string pieceName = hitObj.name; if (pieceName.StartsWith("PuzzlePiece")) { startPiece = hitObj; endPiece = hitObj; currentName = hitObj.name; //削除対象オブジェクトリストの初期化 removablePieceList = new List <GameObject>(); //削除対象のオブジェクトを格納 PushToList(hitObj); SE.PlaySE(12); } } } }
void Update() { float distCovered = (Time.time - startTime) * speed; float fracJourney = distCovered / journeyLength; // 粒子座標を更新 transform.position = GetPoint(startMarker, P1Marker, P2Marker, endMarker, distCovered); // 終点まで来たら if (/*transform.position.x >= endMarker.x |*/ transform.position.y >= endMarker.y) { if (nID == 3) { gameManager.SetEffectFlag(true); nSkillCnt = 0; } // 粒子は破棄 Destroy(gameObject); if (bflag == false) { // スキル・エフェクト生成 EffectObject.PlayEffect(EffectID, new Vector3(endMarker.x, endMarker.y, 10), new Quaternion(0, 0, 0, 0)); enemyRed.SetRedFlash(true); SE.PlaySE(14); SE.PlaySE(0); bflag = true; } } }
/*public void SetRankingTextByPlayerPrefs() * { * string sceneName = SceneManager.GetActiveScene().name; * string playerNameText = ""; * string timeText = ""; * for (int i = 1; i <= 10; i++) * { * if (!PlayerPrefs.HasKey(sceneName + "RankingPlayerName" + i)) break; * playerNameText += i + ". " + PlayerPrefs.GetString(sceneName + "RankingPlayerName" + i) + "\n"; * timeText += PlayerPrefs.GetFloat(sceneName + "RankingTime" + i).ToString() + "\n"; * } * this.rankingPlayerNameText.text = playerNameText; * this.rankingScoreOrTimeText.text = timeText; * * this.playerResultText.text = StaticData.playerName + ": " + TimeManager.Instance.CountTime; * * * string recentPlayerNameText = ""; * string dateText = ""; * for (int i = 1; i <= 10; i++) * { * if (!PlayerPrefs.HasKey(sceneName + "RecentPlayerName" + i)) break; * recentPlayerNameText += i + ". " + PlayerPrefs.GetString(sceneName + "RecentPlayerName" + i) + "\n"; * dateText += PlayerPrefs.GetString(sceneName + "RecentDate" + i) + "\n"; * } * this.recentPlayerNameText.text = recentPlayerNameText; * this.recentDateText.text = dateText; * }*/ public void SetResultAndShowUsedStaticData() { this.rankingPlayerNameText.text = StaticData.highRankResults[SceneManager.GetActiveScene().name].PlayerNameText; this.rankingScoreOrTimeText.text = StaticData.highRankResults[SceneManager.GetActiveScene().name].ResultTimeText; this.recentPlayerNameText.text = StaticData.recentResults[SceneManager.GetActiveScene().name].PlayerNameText; this.recentDateText.text = StaticData.recentResults[SceneManager.GetActiveScene().name].ClearDateText; this.playerResultText.text = StaticData.playerName + ": " + TimeManager.Instance.CountTime; StageManager.Instance.StopAllMoving(); //StartCoroutine(DelayMethodRealTime(0.3f, () => //{ SEManager.PlaySE(SEManager.failed); this.scoreText.SetActive(false); this.timeText.SetActive(false); this.flagCountText.transform.gameObject.SetActive(false); this.gameOverText.SetActive(true); this.smogPanel.SetActive(true); //})); StartCoroutine(DelayMethodRealTime(0.3f, () => { this.gameOverText.SetActive(false); })); StartCoroutine(DelayMethodRealTime(0.5f, () => { SEManager.PlaySE(SEManager.getItem); this.rankingPanel.SetActive(true); this.tweetResultButton.SetActive(false); this.continueButton.Select(); })); }
public void PressNextManual() { this.manual[this.currentIndex].SetActive(false); this.currentIndex = (++this.currentIndex) % this.manualLength; this.manual[this.currentIndex].SetActive(true); SEManager.PlaySE(SEManager.page); }
/*public IEnumerator SetAndShowRankingWhenFailed() * { * this.playerResultText.text = StaticData.playerName + ": " + TimeManager.Instance.CountTime; * StageManager.Instance.StopAllMoving(); * //SetRankingTextByPlayerPrefs(); * //StartCoroutine(DelayMethodRealTime(0.5f, () => * //{ * SEManager.PlaySE(SEManager.failed); * this.scoreText.SetActive(false); * this.timeText.SetActive(false); * this.flagCountText.transform.gameObject.SetActive(false); * this.gameOverText.SetActive(true); * this.smogPanel.SetActive(true); * //})); * StartCoroutine(DelayMethodRealTime(0.5f, () => * { * this.gameOverText.SetActive(false); * })); * * StartCoroutine(SetHighRankingTextFromFailedResult()); * yield return StartCoroutine(SetRecentClearTextFromFailedResult()); * * SEManager.PlaySE(SEManager.getItem); * this.rankingPanel.SetActive(true); * this.tweetResultButton.SetActive(false); * this.continueButton.Select(); * }*/ public IEnumerator SetAndShowRankingWhenClear() { this.playerResultText.text = StaticData.playerName + ": " + TimeManager.Instance.CountTime; StageManager.Instance.StopAllMoving(); //StartCoroutine(DelayMethodRealTime(0.5f, () => //{ SEManager.PlaySE(SEManager.success); this.scoreText.SetActive(false); this.timeText.SetActive(false); this.flagCountText.transform.gameObject.SetActive(false); this.stageClearText.SetActive(true); this.smogPanel.SetActive(true); //})); StartCoroutine(DelayMethodRealTime(0.5f, () => { this.stageClearText.SetActive(false); })); StartCoroutine(SetHighRankingTextFromClearResult()); yield return(StartCoroutine(SetRecentClearTextFromClearResult())); SEManager.PlaySE(SEManager.getItem); this.rankingPanel.SetActive(true); this.continueButton.Select(); StageManager.Instance.SavePlayerResult(); }
public void ViewStaff() { SEManager.PlaySE(SEManager.decision); this.optionView.SetActive(false); this.staffView.SetActive(true); this.backFromViewStaffButton.Select(); }
public void ClearCombo() { //todo;コンボが3より大きければ秒数を増やす if (DragObjList.Count > 3) { m_limitTimeCountViwer.PlusTime(); } if (DragObjList.Count > 2) { m_SEManager.PlaySE(); } foreach (var orbs in DragObjList) { if (orbs.GetComponent <OrbController>().ComboEffect.gameObject.activeSelf) { orbs.GetComponent <OrbController>().ComboEffect.gameObject.SetActive(false); } CurrentComboCount++; } DragObjList.Clear(); }
public void BackFromViewStaff() { SEManager.PlaySE(SEManager.back); this.staffView.SetActive(false); this.optionView.SetActive(true); this.resumeButton.Select(); }
public void PressGoTitle() { //初期化処理 BGMManager.PlayBGM(BGMManager.menuBGM); SEManager.PlaySE(SEManager.decision); SceneManager.LoadScene("Title"); }
public void ShowStageOverView(int overViewIndex) { StageManager.Instance.StopAllMoving(); this.stageOverViewsPanel.SetActive(true); this.overViews[overViewIndex].SetActive(true); SEManager.PlaySE(SEManager.decision); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { SEManager.PlaySE(SEManager.speedUp); collision.transform.parent.GetComponent <Rigidbody2D>().AddRelativeForce(new Vector2(0f, this.moveForce)); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { SEManager.PlaySE(SEManager.speedDown); collision.transform.parent.GetComponent <Rigidbody2D>().velocity *= this.lowerRate; } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { SEManager.PlaySE(SEManager.returnMoveDirection); collision.transform.parent.Rotate(0f, 0f, 180f); } }
private void OnTriggerEnter2D(Collider2D collision) { if (StageManager.Instance.ClearFlagType == E_ClearFlagType.BreakTarget && collision.CompareTag("AttackToEnemy")) { SEManager.PlaySE(SEManager.getItem); this.breakTarget.Invoke(); ClearFlag_BreakTarget.Instance.BreakTarget(); Destroy(this.gameObject); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { SEManager.PlaySE(SEManager.getItem); TimeManager.Instance.AddTime(this.addTimeValue); this.contactPlayerEvent.Invoke(); Destroy(this.gameObject); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { SEManager.PlaySE(SEManager.stopMovement); Rigidbody2D p_rb = collision.transform.parent.GetComponent <Rigidbody2D>(); p_rb.velocity = Vector2.zero; p_rb.angularVelocity = 0f; } }
private void OnTriggerEnter2D(Collider2D collision) { if (StageManager.Instance.ClearFlagType == E_ClearFlagType.CollectItem && collision.CompareTag("Player")) { SEManager.PlaySE(SEManager.getItem); this.getMustCollectItem.Invoke(); ClearFlag_CollectItem.Instance.GetMustCollectItem(); Destroy(this.gameObject); } }
private void Update() { if (Input.GetKeyDown(KeyCode.Return)) { SEManager.PlaySE(SEManager.E_SE.Slash); } if (Input.GetKeyDown(KeyCode.W)) { SEManager.PlaySE(SEManager.E_SE.Jump); } }
public void PressBackManual() { this.manual[this.currentIndex].SetActive(false); this.currentIndex--; if (this.currentIndex < 0) { this.currentIndex = this.manualLength - 1; } this.manual[this.currentIndex].SetActive(true); SEManager.PlaySE(SEManager.page); }
public void PressBackMissionRankingButton() { SEManager.PlaySE(SEManager.select); this.scrollViews[this.showingMissionIndex].SetActive(false); this.showingMissionIndex--; if (this.showingMissionIndex < 0) { this.showingMissionIndex = this.missionCount - 1; } this.scrollViews[this.showingMissionIndex].SetActive(true); this.RankingTitleText.text = "ランキング(Mission" + (this.showingMissionIndex + 1).ToString() + ")"; }
public void SetPlayerName() { if (this.inputField.text == "") { SEManager.PlaySE(SEManager.speedDown); } else { SEManager.PlaySE(SEManager.decision); StaticData.playerName = this.inputField.text; SceneManager.LoadScene("SelectMissionStage"); } }
// Update is called once per frame void Update() { nSetCnt++; // プレイヤーがセットされてたら if (nSetNum == 0) { spriteRenderer.sprite = playerTurn; } // エネミーがセットされてたら else if (nSetNum == 1) { spriteRenderer.sprite = enemyTurn; } if (nSetCnt >= 60) { if (bAlphaOn == false && bFirstTime == true) { fAlpha += 0.03f; } if (fAlpha >= 1.0f) { fAlpha = 1.0f; nCnt++; bAlphaOn = true; if (se == false) { SE.PlaySE(16); se = true; } } if (nCnt >= 30) { fAlpha -= 0.03f; if (fAlpha <= 0) { fAlpha = 0; nCnt = 0; bAlphaOn = false; bFirstTime = false; se = false; } } } spriteRenderer.color = new Color(1.0f, 1.0f, 1.0f, fAlpha); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Q)) { GetComponent <SpriteRenderer>().sprite = tex1; se.PlaySE(3); em.PlayEffect(0, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0)); } if (Input.GetKeyDown(KeyCode.W)) { GetComponent <SpriteRenderer>().sprite = tex2; se.PlaySE(4); em.PlayEffect(3, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0)); } if (Input.GetKeyDown(KeyCode.E)) { GetComponent <SpriteRenderer>().sprite = tex3; se.PlaySE(5); em.PlayEffect(10, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0)); } if (Input.GetKeyDown(KeyCode.R)) { GetComponent <SpriteRenderer>().sprite = tex4; se.PlaySE(50); em.PlayEffect(15, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0)); } }
public void PressGoStage() { SEManager.PlaySE(SEManager.decision); StageManager.Instance.MoveAllMoving(); if (this.gameObject.name == "Mission10" || this.gameObject.name == "Mission11") { BGMManager.PlayBGM(BGMManager.bossBGM0); } else { BGMManager.PlayBGM(BGMManager.missionBGM); } SceneManager.LoadScene(this.gameObject.name); }
public void PressResume() { SEManager.PlaySE(SEManager.back); StageManager.Instance.MoveAllMoving(); if (!StageManager.Instance.IsStageScene) { if (MenuUIManager.Instance.CurrentSelectType == E_MenuType.Option) { MenuUIManager.Instance.OptionPanel.SetActive(true); } OptionClickManager.Instance.OptionIcon.SetActive(true); } this.gameObject.SetActive(false); }
public void UpdateScore(Vector3 pos) { // 上からレイを出して確認する int min = 9999; int max = 0; for (int i = 0; i < Width; ++i) { RaycastHit hit; Ray ray = new Ray(new Vector3(i, fallBlock.transform.position.y - 1, 0), Vector3.down); Physics.Raycast(ray, out hit); score [i] = Mathf.RoundToInt(hit.transform.position.y + 0.3f); // 時間がないのでマジックナンバー if (min > score [i]) { min = score [i]; } if (max < score [i]) { max = score [i]; } } Debug.Log(max); //minとmaxが5以上離れていれば終わり Debug.Log(min.ToString() + ":" + max.ToString()); if (min + 5 < max) { gameManager.FinishGame(); return; } // ライン揃えたボーナス if (prevMaxHeight < min) { prevMaxHeight = min; p_seManager.PlaySE(2); scoreManager.AddScore(oneLineScore); ViewOneLineScore(pos); } // 一番下が3を超えたらだんだん高くなる if (min - 1 > climb) { ++climb; Camera.main.transform.position += Vector3.up; fallBlock.transform.position += Vector3.up; nextFallBlock.transform.position += Vector3.up; nextFallPos += Vector3.up; standardFallPos += Vector3.up; } }
public void ClearCombo() { if (DragObjList.Count > 4) { m_limitTimeCountViewer.PlusTime(); } if (DragObjList.Count > 2) { m_semanager.PlaySE(); } //コンボが3以上だったら増やす foreach (var orbs in DragObjList) { if (orbs.GetComponent <OrbController>().ComboEffect.gameObject.gameObject) { orbs.GetComponent <OrbController>().ComboEffect.gameObject.SetActive(false); } } DragObjList.Clear(); m_semanager.PlaySE(); DragObjList.Clear(); }
public void PressResume() { SEManager.PlaySE(SEManager.back); if (StageManager.Instance.IsStageScene) { StageUIManager.Instance.PausePanel.SetActive(true); StageUIManager.Instance.ResumeButton.Select(); } else { StageManager.Instance.MoveAllMoving(); MenuUIManager.Instance.ManualPanel.SetActive(true); OptionClickManager.Instance.OptionIcon.SetActive(true); } this.gameObject.SetActive(false); }
//-------------------------------------------------- // スタート //-------------------------------------------------- void Start() { GameState = DEFINE.GAME_STATE.PLAYER_TURN; // ゲーム状態 player = GetComponent <Player>(); // プレイヤー情報を取得 enemy = GetComponent <Enemy>(); // エネミー情報を取得 PieceList = GetComponentInChildren <PieceList>(); // ピースのリストを取得 skillChecker = GetComponent <SkillChecker>(); // スキル情報を取得 nCnt = 0; SE.PlaySE(1); }
public void ClickOptionIcon() { if (this.optionPanel.activeSelf) { this.optionPanel.SetActive(false); SEManager.PlaySE(SEManager.back); StageManager.Instance.MoveAllMoving(); } else { //StageManager.Instance.IsPausing = true; StageManager.Instance.StopAllMoving(); this.optionPanel.SetActive(true); this.resumeButton.Select(); SEManager.PlaySE(SEManager.pause); } }