質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
C

C言語は、1972年にAT&Tベル研究所の、デニス・リッチーが主体となって作成したプログラミング言語です。 B言語の後継言語として開発されたことからC言語と命名。そのため、表記法などはB言語やALGOLに近いとされています。 Cの拡張版であるC++言語とともに、現在世界中でもっとも普及されているプログラミング言語です。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Q&A

解決済

3回答

7568閲覧

unityのコンパイルエラーが治せません

tetsunosuke0320

総合スコア6

C

C言語は、1972年にAT&Tベル研究所の、デニス・リッチーが主体となって作成したプログラミング言語です。 B言語の後継言語として開発されたことからC言語と命名。そのため、表記法などはB言語やALGOLに近いとされています。 Cの拡張版であるC++言語とともに、現在世界中でもっとも普及されているプログラミング言語です。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

0グッド

0クリップ

投稿2020/02/13 14:06

編集2020/02/13 21:58

cここに言語を入力
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class boost:MonoBehaviour
{
public GameObject score_object = null;
public GameObject bulletPrefab;
public float shotSpeed;
public int shotCount = 30;
private float shotInterval;

void Update() { if (Input.GetKey(KeyCode.Space )) { shotInterval += 1; if (shotInterval % 5 == 0 && shotCount > 0) { shotCount -= 1; GameObject bullet = (GameObject)Instantiate(bulletPrefab, transform.position, Quaternion.Euler(transform.parent.eulerAngles.x, transform.parent.eulerAngles.y, 0)); Rigidbody bulletRb = bullet.GetComponent<Rigidbody>(); bulletRb.AddForce(transform.forward * shotSpeed); //射撃されてから3秒後に銃弾のオブジェクトを破壊する. Destroy(bullet, 0.2f); } } else if (Input.GetKeyDown(KeyCode.R)) { shotCount = 300; } Text score_text = score_object.GetComponent<Text>(); // テキストの表示を入れ替える score_text.text = "fuel" + shotCount; }

}

```c using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class Chase : MonoBehaviour { public GameObject target; private NavMeshAgent agent; void Start() { agent = GetComponent<NavMeshAgent>(); } void Update() { // ターゲットの位置を目的地に設定する。 agent.destination = target.transform.position; } } c using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Collections; public class oto : MonoBehaviour { private AudioSource sound01; private AudioSource sound02; void Start() { //AudioSourceコンポーネントを取得し、変数に格納 AudioSource[] audioSources = GetComponents<AudioSource>(); sound01 = audioSources[0]; } void Update() { //指定のキーが押されたら音声ファイル再生 if (Input.GetKey(KeyCode.Mouse0)) { sound01.PlayOneShot(sound01.clip); } if (Input.GetKey(KeyCode.Space)) { sound02.PlayOneShot(sound02.clip); } } } c using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Collections; public class oto2 : MonoBehaviour { private AudioSource sound01; void Start() { //AudioSourceコンポーネントを取得し、変数に格納 sound01 = GetComponent<AudioSource>(); } void Update() { //指定のキーが押されたら音声ファイル再生 if (Input.GetKey(KeyCode.Space)) { sound01.PlayOneShot(sound01.clip); } } c using System.Collections; using System.Collections.Generic; using UnityEngine; public class Seisei : MonoBehaviour { // 出現させる敵を入れておく [SerializeField] GameObject[] enemys; // 次に敵が出現するまでの時間 [SerializeField] float appearNextTime; // この場所から出現する敵の数 [SerializeField] int maxNumOfEnemys; // 今何人の敵を出現させたか(総数) private int numberOfEnemys; // 待ち時間計測フィールド private float elapsedTime; // Use this for initialization void Start() { numberOfEnemys = 0; elapsedTime = 0f; } void Update() { // この場所から出現する最大数を超えてたら何もしない if (numberOfEnemys >= maxNumOfEnemys) { return; } // 経過時間を足す elapsedTime += Time.deltaTime; // 経過時間が経ったら if (elapsedTime > appearNextTime) { elapsedTime = 0f; AppearEnemy(); } } void AppearEnemy() { // 出現させる敵をランダムに選ぶ var randomValue = Random.Range(0, enemys.Length); // 敵の向きをランダムに決定 var randomRotationY = Random.value * 360f; GameObject.Instantiate(enemys[randomValue], transform.position, Quaternion.Euler(0f, randomRotationY, 0f)); numberOfEnemys++; elapsedTime = 0f; } } c using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Shooting : MonoBehaviour { public GameObject score_object = null; public GameObject bulletPrefab; public float shotSpeed; public int shotCount = 30; private float shotInterval; public Explosion m_explosionPrefab; public AudioClip audioClip1; private AudioSource audioSource; void Update() { if (Input.GetKey(KeyCode.Mouse0)) { shotInterval += 1; if (shotInterval % 5 == 0 && shotCount > 0) { shotCount -= 1; GameObject bullet = (GameObject)Instantiate(bulletPrefab, transform.position, Quaternion.Euler(transform.parent.eulerAngles.x, transform.parent.eulerAngles.y, 0)); Rigidbody bulletRb = bullet.GetComponent<Rigidbody>(); bulletRb.AddForce(transform.forward * shotSpeed); //射撃されてから3秒後に銃弾のオブジェクトを破壊する. Destroy(bullet, 3.0f); } } else if (Input.GetKeyDown(KeyCode.R)) { shotCount = 30; } Text score_text = score_object.GetComponent<Text>(); // テキストの表示を入れ替える score_text.text = "bullet" + shotCount; } } c using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class teki : MonoBehaviour { // Start is called before the first frame update void Start() { } void OnTriggerEnter(Collider other) { //ぶつかったオブジェクトのTagにShellという名前が書いてあったならば(条件). if (other.CompareTag("teki")) { //HPクラスのDamage関数を呼び出す //ぶつかってきたオブジェクトを破壊する. SceneManager.LoadScene("result"); } } } c using System.Collections; using System.Collections.Generic; using UnityEngine; public class Explosion : MonoBehaviour { private void Start() { // 演出が完了したら削除する var particleSystem = GetComponent<ParticleSystem>(); Destroy(gameObject, particleSystem.main.duration); } } c using System.Collections; using System.Collections.Generic; using UnityEngine; public class bakuhatsu : MonoBehaviour { private AudioSource audioSource; public AudioClip audioClip1; public Explosion m_explosionPrefab; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() {if (Input.GetKey(KeyCode.Mouse0)) ; Instantiate( m_explosionPrefab, transform.localPosition, Quaternion.identity); audioSource = gameObject.GetComponent<AudioSource>(); audioSource.clip = audioClip1; audioSource.Play(); } }
```unityでc#でfpsゲームを作っているのですが、先ほどunityのパッケージをインポートして再生しよう としたら (1) Library\PackageCache\com.unity.postprocessing@2.0.3-preview\PostProcessing\Runtime\PostProcessManager.cs(424,66): error CS0117: 'EditorSceneManager' does not contain a definition for 'IsGameObjectInScene' (2)  Library\PackageCache\com.unity.postprocessing@2.0.3-preview\PostProcessing\Runtime\PostProcessManager.cs(425,66): error CS0117: 'EditorSceneManager' does not contain a definition for 'IsGameObjectInMainScenes' と出てきてしまいます。初心者なのでよくわかりません。なので 1 解決策 2 原因 を教えてください。よろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

y_waiwai

2020/02/13 14:24

コードを提示しましょう
cider0318

2020/02/13 22:41

その出てきてしまう文章には、 EditorSceneManagerにIsGameObjectInSceneの定義がありません。 EditorSceneManagerにIsGameObjectInMainScenesの定義がありません。 と書いているようです。 これで解決策も原因も分かりそうですが、いかがでしょうか。
tetsunosuke0320

2020/02/14 00:33

その原因になっていると思われるスクリプトがライブラリフォルダのスクリプトで直し方がよくわかりません
guest

回答3

0

Postporocessing をアップデートしたら治りました
ありがとうございました

投稿2020/02/14 01:54

tetsunosuke0320

総合スコア6

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

ググっただけですが、
https://forum.unity.com/threads/postprocessmanager-error-with-editorscenemanager.673645/
に同じ質問が挙がってるみたいですよ。

To fix this, you can delete path/to/game//Library/PackageCache/ the post processing folder

で回避できるようです。

投稿2020/02/14 00:42

takabosoft

総合スコア8356

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

ベストアンサー

エラーコードでググれば情報が出て来ます。
c# - error CS0117: 'EditorSceneManager' does not contain a definition for 'IsGameObjectInScene' - Stack Overflow
という訳でPostProcssingのパッケージをアップデートしてみてください。

投稿2020/02/14 00:40

sakura_hana

総合スコア11427

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問