커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
1주차 패널버튼 오류
undefined주차
북마크
김*재
댓글
4
추천
0
조회수
22
조회수
22
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


패널 버튼을 만들고 버튼을 눌러도 retry가 되지 않고 오류가 납니다



스파르타 즉문즉답





Scene 'MainScene' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
To add a scene to the build settings use the menu File->Build Settings...
UnityEngine.SceneManagement.SceneManager:LoadScene (string)
gamemanager:retry () (at Assets/script/gamemanager.cs:55)
panel:retry () (at Assets/script/panel.cs:21)
UnityEngine.EventSystems.EventSystem:Update ()




using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class panel : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }


    // Update is called once per frame
    void Update()
    {
        
    }


    public void retry()
    {
        gamemanager.I.retry();
    }


}



using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;


public class gamemanager : MonoBehaviour
{
    public GameObject rain;
    public GameObject panel;
    public static gamemanager I;
    public Text scoretext;
    public Text timetext;
    int totalscore;
    float limit = 5f;


    void Awake()
    {
        I = this;
    }


    // Start is called before the first frame update
    void Start()
    {
        InvokeRepeating("makeRain", 0, 0.5f);
    }


    // Update is called once per frame
    void Update()
    {
        limit -= Time.deltaTime;
        if (limit < 0)
        {
            Time.timeScale = 0.0f;
            panel.SetActive(true);
            limit = 0.0f;
        }
        timetext.text = limit.ToString("n2");
    }


    void makeRain()
    {
        Instantiate(rain);
    }


    public void addscore(int score)
    {
        totalscore += score;
        scoretext.text = totalscore.ToString();
    }


    public void retry()
        {
        SceneManager.LoadScene("MainScene");
        }


}


취소
 공유
취소
댓글 0
댓글 알림
나의얼굴