Unity Spain
Post Antiguos => General (Antiguo) => Mensaje iniciado por: ochoag en Marzo 17, 2016, 09:50:13 PM
I have been trying to call a function of c# to my JavaScript GameState:this function:with this variables: bool _isWon;
bool _isLost; void Update ()
{
if (LevelManager.Instance.IsLevelRunning && (_isWon || _isLost))
{
Assert.IsTrue(LevelManager.IsActive, "Please ensure that you have a LevelManager component added to your scene.");
Assert.IsTrue(GameOver.IsActive, "Please ensure that you have a GameOver component added to your scene, or are using one of the default GameOver prefabs."); LevelManager.Instance.LevelFinished();
GameOver.Instance.Show(_isWon);
}
}or void Update ()
{
if (LevelManager.Instance.IsLevelRunning && (_isWon || _isLost))
{
Assert.IsTrue(LevelManager.IsActive, "Please ensure that you have a LevelManager component added to your scene.");
Assert.IsTrue(GameOver.IsActive, "Please ensure that you have a GameOver component added to your scene, or are using one of the default GameOver prefabs."); LevelManager.Instance.LevelFinished();
GameOver.Instance.Show(_isLost);
}
}everything to call that Game is Over or Game is Won but in my GameState JavaScript I have the functionally of GAME the only that I want is call these function to my part: function Update ()
{
if(vida <=0)
{
here when is Lost
} if(timer <=0 && puntos >= 50)
{
here when is Won
}
if(timer <=0 && puntos < 50)
{
here when is Lost
}
print("Puntuacion: "+puntos);
print ("Vidas: "+vida);
}someone can help me in these part.??? I have been searching but not have found the solution for my problem....