Unity
- 18 ответов
- 0 вопросов
10
Вклад в тег
using UnityEngine;
using UnityEngine.SceneManagement;
public class GoNextStage : MonoBehaviour
{
int item;
void PickUpIntem()
{
item++;
if (!(item < 15)) Loader();
}
void Loader()
{
SceneManager.LoadScene("Second"); //<=Название след сцены
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Item")
{
other.gameObject.SetActive(false);
PickUpIntem();
}
}
}
if (Input.GetKeyDown(KeyCode.Z) && !isPressed)
{
target = turretParent;
distance = dist;
heightPosition = height;
isPressed = true;
}
if (Input.GetKeyDown(KeyCode.Z) && isPressed)
{
target = turretBarrel;
distance = 0f;
heightPosition = 0f;
isPressed = false;
}