//被弾時の処理 public IEnumerator Damaged() { if (GetComponentInChildren <PlayerBodyCollision>().Is_Invincible()) { yield break; } if (PlayerManager.Instance.Reduce_Life() == 0) { yield break; } PlayerBodyCollision body_Collision = GetComponentInChildren <PlayerBodyCollision>(); invincible_Time_Length = 2.0f; if (GetComponent <PlayerController>().Get_Is_Ride_Beetle()) { invincible_Time_Length = 3.0f; } Put_Out_Power(PlayerManager.Instance.Get_Power() / 8); //パワーの減少 BeetlePowerManager.Instance.StartCoroutine("Increase_Cor", 25); //飛行パワー増加 StartCoroutine("Blink"); //点滅 player_SE.Play_Damaged_Sound(); //効果音 Occure_Knock_Back(); //反動 body_Collision.Become_Invincible(); //無敵化 Play_Delete_Bullet_Bomb(); //弾消しようのボム yield return(new WaitForSeconds(invincible_Time_Length + 1.0f)); //無敵時間 body_Collision.Release_Invincible(); //戻す }
// Use this for initialization void Awake() { //取得 _controller = GetComponent <PlayerController>(); _shoot = GetComponent <PlayerShoot>(); player_Effect = GetComponentInChildren <PlayerEffect>(); player_SE = GetComponentInChildren <PlayerSoundEffect>(); player_Body = GetComponentInChildren <PlayerBodyCollision>(); _rigid = GetComponent <Rigidbody2D>(); kick_Collision = GetComponentInChildren <PlayerKickCollision>(); }
//Start private void Start() { //取得 main_Camera = GameObject.FindWithTag("MainCamera"); beetle_Body = transform.Find("BeetleBody").gameObject; body_Collision = GetComponentInChildren <PlayerBodyCollision>(); _controller = GetComponent <PlayerController>(); //初期値代入 default_Gravity = GetComponent <Rigidbody2D>().gravityScale; default_Collider_Size = GetComponentInChildren <CapsuleCollider2D>().size; }
//会話 virtual protected IEnumerator Talk() { is_Talking = true; end_Talk = false; GameObject player = GameObject.FindWithTag("PlayerTag"); PlayerController player_Controller = player.GetComponent <PlayerController>(); PlayerBodyCollision player_Collision = player.GetComponentInChildren <PlayerBodyCollision>(); talk_Count++; //会話開始 if (player_Controller.Get_Is_Playable()) { //自機を止める player_Controller.Set_Is_Playable(false); yield return(null); player.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); player_Controller.Change_Animation("IdleBool"); //自機無敵化 player_Collision.Become_Invincible(); //ポーズ禁止 PauseManager.Instance.Set_Is_Pausable(false); yield return(new WaitForSeconds(Action_Before_Talk())); player.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); //メッセージ表示 if (dual_Panel) { _message_Custom.Start_Display(fileName, start_ID, end_ID); yield return(new WaitUntil(_message_Custom.End_Message)); } else { _message.Start_Display(fileName, start_ID, end_ID); yield return(new WaitUntil(_message.End_Message)); } //終了 yield return(new WaitForSeconds(0.1f)); player_Controller.Set_Is_Playable(true); player_Collision.Release_Invincible(); PauseManager.Instance.Set_Is_Pausable(true); } Action_In_End_Talk(); end_Talk = true; is_Talking = false; }
//Start private void Awake() { //取得 main_Camera = GameObject.FindWithTag("MainCamera"); beetle_Body = transform.Find("BeetleBody").gameObject; body_Collision = GetComponentInChildren <PlayerBodyCollision>(); foot_Collision = GetComponentInChildren <PlayerFootCollision>(); _controller = GetComponent <PlayerController>(); player_Effect = GetComponentInChildren <PlayerEffect>(); //初期値代入 default_Gravity = GetComponent <Rigidbody2D>().gravityScale; default_Collider_Offset = GetComponentInChildren <CapsuleCollider2D>().offset; }
//被弾時の処理 public IEnumerator Damaged() { if (PlayerManager.Instance.Reduce_Life() == 0) { yield break; } PlayerBodyCollision body_Collision = GetComponentInChildren <PlayerBodyCollision>(); Put_Out_Power(PlayerManager.Instance.Get_Power() / 8); //パワーの減少 StartCoroutine("Blink"); //点滅 body_Collision.Become_Invincible(); //無敵化 Occure_Knock_Back(); //反動 yield return(new WaitForSeconds(INVINCIBLE_TIME_LENGTH)); //無敵時間 body_Collision.Release_Invincible(); //戻す }
// Use this for initialization void Start() { //取得 _controller = GetComponent <PlayerController>(); player_Body = GetComponentInChildren <PlayerBodyCollision>(); }