Exemple #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;
 }
Exemple #2
0
 void IPunInstantiateMagicCallback.OnPhotonInstantiate(PhotonMessageInfo info)
 {
     if (gameManager != null)
     {
         currentLevel = gameManager.AR.ActiveLevel;
         if (currentLevel != null)
         {
             // scaling character
             transform.parent = currentLevel.transform;
         }
     }
 }
    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);
            }
        }
    }
    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();
        }
    }
Exemple #5
0
 public void OnARLevelStopped(ARLevel _stoppedLevel)
 {
     LevelStopped?.Invoke(_stoppedLevel);
 }
Exemple #6
0
 public void OnARLevelStarted(ARLevel _startedLevel)
 {
     LevelStarted?.Invoke(_startedLevel);
 }