前提・実現したいこと
ここに質問の内容を詳しく書いてください。
(例)Unity2018.2.14f1で、私自身が21歳から11歳に戻り、
プログラム上のキャラクターと仲良くするプログラムを作っています。
発生している問題・エラーメッセージ
次の場面に進まない。 Scene→introduction1→introduction2 の順にしたいが、うまくいかない。
該当のソースコード
scene1.cs //Scene用
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class scene1 : MonoBehaviour
{
// Inspector上で次のシーン名を設定
public string scene2;
void changeFirst()
{
if (Time.timeSinceLevelLoad > 2.0f)
{
SceneManager.LoadScene(scene2, LoadSceneMode.Single); } } // Update is called once per frame void Update() { changeFirst(); }
}
scene2.cs //introduction1用
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class scene2 : MonoBehaviour
{
// Inspector上で次のシーン名を設定
public string scene3;
void changeSecond()
{
if (Time.timeSinceLevelLoad > 10.0f)
{
SceneManager.LoadScene(scene3, LoadSceneMode.Single); } } // Update is called once per frame void Update() { changeSecond(); }
}
scene3.cs //introduction2用
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization void Start () { } // Update is called once per frame void Update () { }
}
あなたの回答
tips
プレビュー