커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
패널 초기화, 다시 시작하기가 안되네요
undefined주차
북마크
박*현
댓글
1
추천
0
조회수
18
조회수
18
답변 완료




마지막 단계, 패널이 뜨고 누르면 멈추는 것까지만 가능하네요.

다시 시작이 안됩니다ㅜㅜ

어떤거에서 문제인지 모르겠어요

틀린 문법도 없어보이고

오류도 안뜨고

panel의 클릭 뭐시기 설정부분에서 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()

  {

    initGame();

    InvokeRepeating("makeRain", 0, 0.5f);


  }


  // Update is called once per frame

  void Update()

  {

    limit -= Time.deltaTime;

    if (limit < 0)

    {

      limit = 0.0f;

      Panel.SetActive(true);

      Time.timeScale = 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");

  }


  void initGame()

  {

    Time.timeScale = 1.0f;

    totalScore = 0;

    limit = 5f;


  }

}


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