그 튜토리얼로 하는 roll a ball이라고 해서 따라해보는데 계속 한 씬에서 noe loaded를 반복하기만 해서요....
PlayerBall.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class PlayerBall : MonoBehaviour
{
public int itemCount;
public float jumpPower;
public GameManagerLogic manager;
bool isJump;
Rigidbody rigid;
AudioSource audio;
void Awake()
{
isJump = false;
rigid = GetComponent<Rigidbody>();
audio = GetComponent<AudioSource>();
audio.playOnAwake = false;
}
void Update()
{
if (Input.GetButtonDown("Jump") && !isJump)
{
isJump=true;
rigid.AddForce(new Vector3(0, jumpPower, 0), ForceMode.Impulse);
}
}
void FixedUpdate()
{
float h = Input.GetAxisRaw("Horizontal");
float v = Input.GetAxisRaw("Vertical");
rigid.AddForce(new Vector3(h, 0, v), ForceMode.Impulse);
}
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Tester")
isJump = false;
}
void OnTriggerEnter(Collider other)
{
if (other.tag == "Item")
{
itemCount++;
audio.Play();
other.gameObject.SetActive(false);
manager.GetItem(itemCount);
}
else if (other.tag == "Point")
{
if (itemCount == manager.totalItemCount)
{
if (manager.stage == 2)
SceneManager.LoadScene(0);
else
SceneManager.LoadScene(manager.stage + 1);
}
else
{
SceneManager.LoadScene(manager.stage);
}
}
}
}
이 두개로 실행을 하는데 계속 계층에서 씬이 깜빡거리고 움직이지 않아서 그런데 혹시 어디가 문제인지 봐주실 수 있을까요?
빌드세팅에 씬 빌드함?
네. 그건 다 해서 돌아가는 거 확인을 했는데 playerball에서 else if 수정하니까 안되서요..
빌드에 넣으면 되는게 맞는데... 뭘까요...