level 1
sdsqazz
楼主
初学u3d,按一个较老的教程做了个鸟移动碰撞特殊物品后切换到通关画面的练习,移动没问题,可碰撞之后就是不切换场景,实在搞不明白,各位大神指点一下

" class="BDE_Image" onload="EditorUI.resizeImage(this, 560)" unselectable="on"/>

" class="BDE_Image" onload="EditorUI.resizeImage(this, 560)" unselectable="on"/>
vs2019中显示碰撞代码从未使用
下面是详细代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
void OnCollisionEnter2D(Collision2D coll)
{
if (coll.collider.gameObject.name == "shit")
{
SceneManager.LoadScene(1);
}
SceneManager.LoadScene(1);
}
}
}
2023年02月07日 13点02分
1

" class="BDE_Image" onload="EditorUI.resizeImage(this, 560)" unselectable="on"/>
" class="BDE_Image" onload="EditorUI.resizeImage(this, 560)" unselectable="on"/>vs2019中显示碰撞代码从未使用
下面是详细代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
void OnCollisionEnter2D(Collision2D coll)
{
if (coll.collider.gameObject.name == "shit")
{
SceneManager.LoadScene(1);
}
SceneManager.LoadScene(1);
}
}
}