private IEnumerator Attack_Cor() { _anim.SetTrigger("ConvergeTrigger"); _se.Play("Charge"); Vector3 direction; for (float t = 0; t < 1.85f; t += Time.deltaTime) { if (player == null) { yield break; } direction = (player.transform.position - transform.position).normalized; transform.position += direction * 0.8f * Time.timeScale; yield return(null); } _se.Play("Shutter1"); yield return(new WaitForSeconds(0.1f)); _se.Play("Shutter2"); yield return(new WaitForSeconds(0.6f)); transform.localPosition = new Vector3(0, 0, 10); }
private IEnumerator Increase_Time_Count_Cor() { int stock = PlayerManager.Instance.Get_Stock(); if (stock >= 0) { for (int i = 0; i < stock; i++) { time_Count--; stock_UI_Text.text = "× " + (stock - i - 1); stock_UI_Text_Flying.text = "× " + (stock - i - 1); _se.Play("TimeCount"); yield return(new WaitForSeconds(0.1f)); } } else { for (int i = 0; i < -stock; i++) { time_Count += 5; stock_UI_Text.text = "× " + (stock + i + 1); stock_UI_Text_Flying.text = "× " + (stock + i + 1); _se.Play("TimeCount"); yield return(new WaitForSeconds(0.1f)); } } yield return(null); }
//里乃突進攻撃 private void Rush_By_Satono(int direction) { Vector2 pos = player.transform.position + new Vector3(direction * 16f, 0); satono.transform.position = new Vector3(pos.x, 160f); satono.transform.localScale = new Vector3(-direction, 1, 1); satono_Move.Start_Move(new Vector3(pos.x, -380f), 1); _se.Play("Attack"); }
//direction == 1で右方向に移動 private IEnumerator Move_Blocks(GameObject[] blocks, int direction) { while (true) { //真ん中に着いたとき抜ける if (Mathf.Abs(blocks[0].transform.position.x) < center_Pos) { break; } //移動 foreach (var block in blocks) { block.transform.position += new Vector3(move_Speed * direction, 0, 0); } yield return(new WaitForSeconds(0f)); } //真ん中に着いた camera_Shake.Shake(0.5f, new Vector2(1f, 1f), true); _se.Play("Impact"); yield return(new WaitForSeconds(1.0f)); //ブロックを消す foreach (var block in blocks) { CrashBlockController c = block.GetComponent <CrashBlockController>(); if (c == null) { block.SetActive(false); } else { c.Crash(); } } }
private IEnumerator Melody_Bridge_Cor() { base.Set_Can_Switch_Attack(false); //溜め _effect.Play_Power_Charge_Effect_Blue(); yield return(new WaitForSeconds(1.0f)); while (true) { //火柱予測線 float pos_X = player.transform.position.x; _effect.Play_Pre_Blue_Fire_Pillar_Effect(pos_X); yield return(new WaitForSeconds(1.0f)); //火柱生成 _effect.Stop_Power_Charge_Effect_Blue(); _effect.Play_Burst_Effect_Blue(); _shoot.Shoot_Blue_Pillar(pos_X); _se.Play("FirePillar"); camera_Shake.Shake(2.0f, new Vector2(2f, 2f), true); yield return(new WaitForSeconds(1.13f)); //メロディ切り替わったら抜ける if (melody_Manager.Get_Now_Melody() != MelodyManager.Melody.bridge) { break; } } base.Set_Can_Switch_Attack(true); base.Restart_Attack(); }
//ボスステージ進入失敗 public void BossStartFailed() { //表示 DisplayInfomationText.text = "ゲームオーバー!"; //キャラクターがゆっくり止まる status = Question.SolveStatus.Stoping; //SE SEManagerPrefab.Play(SEManager.SEs.InCorrect); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Enemy") { SEManager.Play(SEManager.ClipName.Hit); Destroy(collision.gameObject); Destroy(gameObject); } }
// Update is called once per frame void FixedUpdate() { bool isSeeEnemy = false; Vector2 playerPos = GameObject.FindGameObjectWithTag("Player").transform.position; float playerDistance = Vector2.Distance(playerPos, gameObject.transform.position); if (playerDistance <= sightRange) { isSeeEnemy = true; } skillDelayTimer -= Time.deltaTime; if (aiMode == SkeletonAIMode.Idle) { if (isSeeEnemy == true) { aiMode = SkeletonAIMode.Dodge; } } else if (aiMode == SkeletonAIMode.Dodge) { if (skillDelayTimer <= 0) { //스킬 쿨이 있으면 3칸 안으로 다가와서 때림 if (moveRoutine == null && playerDistance > 3) { Vector2 nextPos = GameObject.Find("Astar").GetComponent <Astar>().PathFinding(gameObject.transform.position, playerPos); moveRoutine = StartCoroutine(MoveTo(nextPos)); } else if (playerDistance <= 3) { aiMode = SkeletonAIMode.Skill; } } //스킬 쿨이 없으면 3칸 거리두기 시도 else if (playerDistance < 3f) { if (moveRoutine == null) { Vector2 nextPos = GameObject.Find("Astar").GetComponent <Astar>().PathFinding(gameObject.transform.position, playerPos); moveRoutine = StartCoroutine(MinusMoveTo(nextPos)); } } } else if (aiMode == SkeletonAIMode.Skill) { skillDelayTimer = skillDelay; var obj = Instantiate(boneAttack, transform.position, Quaternion.identity); var atd = obj.GetComponent <AttackData>(); atd.attackType = AttackType.AtkBow; atd.damage = unitInfo.GetAtk(1); // 스킬 1atk 추가연산 atd.attackRotation = ((Vector3)playerPos - transform.position).normalized; se.Play(5); aiMode = SkeletonAIMode.Dodge; skillDelayTimer = skillDelay; } }
void ShotBomb() { currentBomb -= 1; UpdatePlayerBombUI(); SEPlayer.Play(SEManager.Sounds.Bomb); if (bombObj == null) { FindObjectsOfType <Bullet>().ToList().ForEach(bullet => { if (bullet.tag == "EnemyBullet") { bullet.DestroyBullet(); } }); FindObjectOfType <Boss>().Damaged(bombDamage); } else { Instantiate(bombObj, transform.position, Quaternion.identity); } }
private IEnumerator ShowResult() { yield return(new WaitForSeconds(1)); time.gameObject.SetActive(true); SEManager.Play(SEManager.ClipName.Don); yield return(new WaitForSeconds(1)); comment.gameObject.SetActive(true); SEManager.Play(SEManager.ClipName.Dondon); yield return(new WaitForSeconds(1)); (success ? successText : failText).gameObject.SetActive(true); SEManager.Play(success?SEManager.ClipName.Success:SEManager.ClipName.Fail); }
public void EquipSelectedItem() { se.Play(8); if (myItems.Count > myItemsSelected) { if (myItemsEquipped == myItemsSelected) { myItemsEquipped = -1; } else { myItemsEquipped = myItemsSelected; } UpdateUI(); } }
// Update is called once per frame void Update() { if ((!isStart) && (textManager.dialogueState == TextManager.DialogueState.Ingame)) { GetComponent <Boss>().patternCoroutine = StartCoroutine(StartPattern()); isStart = true; } if ((boss.currentHp < boss.maxHp / 10f) && (textManager.dialogueState == TextManager.DialogueState.Ingame)) { StopPattern(); boss.DestroyAllBullets(); SEPlayer.Play(SEManager.Sounds.EnemyDeath); textManager.dialogueState = TextManager.DialogueState.After; } }
//白点滅 private IEnumerator Blink_Cor(int count, bool play_SE) { SpriteRenderer _sprite = GetComponent <SpriteRenderer>(); SEManager _se = GetComponentInChildren <SEManager>(); for (int i = 0; i < count; i++) { _sprite.color = new Color(0.7f, 0.7f, 0.7f, 1); if (play_SE) { _se.Play("Flash"); } yield return(new WaitForSeconds(0.1f)); _sprite.color = new Color(0.5f, 0.5f, 0.5f, 1); yield return(new WaitForSeconds(0.1f)); } }
private IEnumerator Warp_Cor(Vector2 next_Pos) { _eternal.Change_Animation("CloseTrigger"); _collision.Become_Invincible(); yield return(new WaitForSeconds(0.6f)); GetComponent <SpriteRenderer>().enabled = false; yield return(new WaitForSeconds(0.5f)); transform.position = next_Pos; _eternal.Change_Animation("OpenTrigger"); GetComponent <SpriteRenderer>().enabled = true; state = State.idle; _se.Play("Wing"); yield return(new WaitForSeconds(0.5f)); _collision.Release_Invincible(); }
IEnumerator TripleFireBall() { yield return(null); for (var i = 0; i < 3; i++) { se.Play(5); var playerPos = GameObject.FindGameObjectWithTag("Player").transform.position; var obj = Instantiate(fireAttack, transform.position, Quaternion.identity); var atd = obj.GetComponent <AttackData>(); atd.attackType = AttackType.SatkFire; atd.damage = unitInfo.GetSatk(1); // 스킬 1atk 추가연산 atd.attackRotation = ((Vector3)playerPos - transform.position).normalized; aiMode = MagicalGoblinAIMode.Dodge; yield return(new WaitForSeconds(0.4f)); } aiMode = MagicalGoblinAIMode.Dodge; moveRoutine = null; }
// Update is called once per frame void Update() { energy += Time.deltaTime; if (energy > 1) { energy = 1; } transform.localPosition = new Vector3(0, 0.5f, 0); if (Input.GetButtonDown("Fire1") && energy >= 1) { SEManager.Play(SEManager.ClipName.Shot); var bullet = Instantiate(bulletPrefab); bullet.transform.position = transform.position; bullet.GetComponent <Rigidbody2D>().velocity = (pivot.transform.position - transform.position) * 5; Destroy(bullet, 10); energy = 0; Debug.Log(transform.forward); } energyBar.value = energy; }
private void OnTriggerEnter2D(Collider2D collision) { Debug.Log(collision.tag); if (collision.tag == "Enemy" || collision.tag == "Dragon") { // game over Destroy(gameObject); result.SetActive(true); //over.SetActive(true); SEManager.Play(SEManager.ClipName.Explode); Result.Show(GetTime((int)time), "You Died", false); } else if (collision.tag == "Finish") { // clear Destroy(gameObject); result.SetActive(true); //clear.SetActive(true); SEManager.Play(SEManager.ClipName.Explode); Result.Show(GetTime((int)time), "You Touched\nthe reverse scales!", true); } }
//------- // 開く virtual public void Open() { float doorPosX = doorR.transform.localPosition.x; if (!closePanel.closeFlag) { SE.Play("SE_Gimmick_DoorOpen"); if (doorPosX < maxRange) { doorR.transform.Translate(speedVec); doorL.transform.Translate(-speedVec); } else { // 開きすぎた分 Adjust(maxRange); } // 通れるようにする cantBack.SetActive(false); } }
public void UpFloor() { se.Play(11); nowFloor++; floortext.text = nowFloor.ToString() + "F"; mg.GenerateFloor(); gm.AddGameLog(gm.nowFloor.ToString() + "층으로 올라왔다."); }
//ボタンクリック public void ButtonClicked() { SEManagerInst.Play(selectSE); }
/*答えチェック段階*/ void CheckAnswerPhase(ref float timer, ref SolveStatus status) { //問題が全部入力された if (!bCheckAnswer || (selectedAns != null && curQues.corAns.ToString().Length != selectedAns.Length)) { return; } var currentCorrect = curQues.corAns.ToString(); bool isCorrect = false; if (selectedAns == currentCorrect) { isCorrect = true; } //正誤によるパラメータ設定 if (isCorrect) { ManagerObj.PlayAnimation_CorrectImage(); timer = TICK_O; status = SolveStatus.Correct; SEManagerInst.Play(SEManager.SEs.Correct); //ボスステージの例外 if (bBossStage) { //ダメージエフェクト ManagerObj.GetBoss().Damaged(); } } else { ManagerObj.PlayAnimation_IncorrectImage(); timer = TICK_X; status = SolveStatus.Incorrect; SEManagerInst.Play(SEManager.SEs.InCorrect); //ユーザーが選んだ答えを赤色で表示 AnswerText.color = Color.red; //正解を表示 DisplayCorrectAns(CorrectAnswerText); } /*点数記録*/ if (isCorrect) { if (!bBossStage) { ++CurrentlyUserInfo.score; } else { ++CurrentlyUserInfo.bossScore; } } /*現在の問題は終了*/ bCheckAnswer = false; currentCorrect = null; selectedAns = null; ClearQuestion(); }
private IEnumerator Attack_In_Melody_Intro_Cor() { Set_Can_Switch_Attack(false); //取得 BossCollisionDetection _collision = GetComponent <BossCollisionDetection>(); TracePlayer _trace = Get_Trace_Player(); _trace.enabled = false; //地面に潜る _effect.Jump_And_Landing_Effect(); _collision.Become_Invincible(); _controller.Change_Fly_Parameter(); _sprite.sortingOrder = -6; _se.Play("Dive"); _move_Motion.Start_Move(0); yield return(new WaitUntil(_move_Motion.Is_End_Move)); _controller.Change_Animation("DivingGroundBool"); yield return(new WaitForSeconds(0.1f)); _sprite.sortingOrder = 3; //コピーの生成 if (_controller.Get_Now_Phase() == 2) { Vector2 position = new Vector2(-transform.position.x, transform.position.y); if (Mathf.Abs(transform.position.x) < 5f) { position = new Vector2(120f, transform.position.y); } _copy.Create_Copy(80, false, position); } //自機を追いかける _trace.enabled = true; yield return(new WaitForSeconds(2.09f)); _trace.enabled = false; yield return(new WaitForSeconds(0.33f)); //ジャンプ _collision.Release_Invincible(); _controller.Change_Animation("HighJumpBool"); _move_Motion.Start_Move(1); _effect.Play_A_Letter_Effect(); _effect.Play_Burst_Effect_Red(); UsualSoundManager.Instance.Play_Attack_Sound(); yield return(new WaitForSeconds(1.03f)); //レーザー _controller.Change_Animation("ShootPoseBool"); _effect.Play_Unn_Letter_Effect(); _effect.Play_Burst_Effect_Red(); _shoot.Shoot_Short_Curve_Laser(0.33f); if (_copy.gameObject.activeSelf) { _copy_Shoot.Shoot_Short_Curve_Laser(0.33f); } yield return(new WaitForSeconds(1.65f)); //落下 _controller.Change_Land_Parameter(); yield return(new WaitUntil(foot_Collider.Hit_Trigger)); _effect.Jump_And_Landing_Effect(); _controller.Change_Animation("SquatBool"); //コピーの消去 if (_copy.gameObject.activeSelf) { _copy.Delete_Copy(); } yield return(new WaitForSeconds(1.65f)); //次の攻撃へ Set_Can_Switch_Attack(true); Restart_Attack(); }
public void OnTriggerEnter2D(Collider2D collision) { SE.Play(playMusicTrack); }