- Kod: Zaznacz wszystko
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Dead : MonoBehaviour {
public void Start()
{
Scene level = SceneManager.GetActiveScene();
}
int live = 5;
//public Transform Player;
public void DeadEvent() {
live = live - 1;
Debug.Log("!!!!Ilość żyć: " + live);
if (live <= 0)
{
}
}
}
W kodzie występują dwie metody Start oraz DeadEvent.
Co muszę zrobić abym mógł odwołać się do zmiennej level w metodzie DeadEvent?
Chodzi mi o to, żebym mógł zrobić w zmiennej DeadEvent coś takiego:
- Kod: Zaznacz wszystko
Debug.Log("!!!!Ilość żyć: " + live+level);