Noticias

¡RECUERDA QUE SI ERES UN NUEVO USUARIO, DEBES PRESENTARTE PARA PODER PUBLICAR MENSAJES! | TENEMOS CANAL OFICIAL DE TELEGRAM: t.me/unity3dspain

I need to call a function c# to a JavaScript function

Iniciado por ochoag, Marzo 17, 2016, 09:50:13 PM

Tema anterior - Siguiente tema
Marzo 17, 2016, 09:50:13 PM Ultima modificación: Marzo 17, 2016, 10:02:32 PM por ochoag
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....

Etiquetas: