커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
일주차 마지막 게임 끝내기에서 리트라이버튼을 생성하고 게임이 끝난 상태에서 리트라이버튼이 나오도록 했는데 클릭을 해도 르탄이의 방향만 바뀌고 재시작이 되지 않습니다
게임 개발이 처음이어도 쉽게 배우는 모바일 게임 개발 v0
1주차
북마크
김*구
댓글
23
추천
0
조회수
25
조회수
25
답변 완료
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

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






스파르타 즉문즉답



작성한 코드 및 에러 메세지

using System.Collections;
using System.Collections.Generic;
using System.Xml.Schema;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;




public class GameManager : MonoBehaviour
{
    public static GameManager Instance;
    public GameObject rain;
    public Text TotalScoreTxt;
    public Text TimeTxt;
    public GameObject EndPanel;


    int Totalscore;


    float TotalTime = 30.0f;


    private void Awake()
    {
        Instance = this;
    }


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


    // Update is called once per frame
    void Update()
    {
        if (TotalTime > 0f)
        {
            TotalTime -= Time.deltaTime;
            
        }
        else
        {
            TotalTime = 0f;
            EndPanel.SetActive(true);
            Time.timeScale = 0f;
        }


        TimeTxt.text = TotalTime.ToString("N2");








    }




    void MakeRain() 
    {
        Instantiate(rain);
    }


    public void AddScore(int score) 
    {
     Totalscore += score;
        TotalScoreTxt.text = Totalscore.ToString();




        
    }


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






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




public class RetryButton : MonoBehaviour 
{
   public void Retry()
    {
        GameManager.Instance.Retry();
    }
    
        
    
}


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