Ejemplo n.º 1
0
 private void OnLevelStarted(ARLevel _level)
 {
     currentLevel    = _level;
     pointsText.text = points.ToString();
     ActivateUIView(UIView.CREATE_ROOM);
     gameManager.Audio.PlayMusic(backgroundMusic, 3f, 1f, true);
     gameManager.Audio.MusicVolume = -20;
 }
Ejemplo n.º 2
0
 void IPunInstantiateMagicCallback.OnPhotonInstantiate(PhotonMessageInfo info)
 {
     if (gameManager != null)
     {
         currentLevel = gameManager.AR.ActiveLevel;
         if (currentLevel != null)
         {
             // scaling character
             transform.parent = currentLevel.transform;
         }
     }
 }
Ejemplo n.º 3
0
    void IPunInstantiateMagicCallback.OnPhotonInstantiate(PhotonMessageInfo info)
    {
        if (gameManager != null)
        {
            currentLevel = gameManager.AR.ActiveLevel;
            if (currentLevel != null)
            {
                // scaling character
                transform.parent = currentLevel.transform;
                // transform.localScale = new Vector3(1f, 1f, 1f);

                info.Sender.TagObject = this.gameObject;

                gameManager.Events.OnCharacterSpawned(this.gameObject);
            }
        }
    }
Ejemplo n.º 4
0
    private void ActivateLevel(ARLevel _level)
    {
        if (_level != ActiveLevel)
        {
            if (ActiveLevel != null)
            {
                ActiveLevel.StopLevel();
            }
            ActiveLevel = _level;
            Debug.Log("Start Level!");

            // set all level inactive
            Array.ForEach(levels, l => l.gameObject.SetActive(false));
            if (!_level.gameObject.activeSelf)
            {
                _level.gameObject.SetActive(true);
            }

            // start ARLevel
            _level.StartLevel();
        }
    }
Ejemplo n.º 5
0
 public void OnARLevelStopped(ARLevel _stoppedLevel)
 {
     LevelStopped?.Invoke(_stoppedLevel);
 }
Ejemplo n.º 6
0
 public void OnARLevelStarted(ARLevel _startedLevel)
 {
     LevelStarted?.Invoke(_startedLevel);
 }