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; }
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(); } }
public void OnARLevelStopped(ARLevel _stoppedLevel) { LevelStopped?.Invoke(_stoppedLevel); }
public void OnARLevelStarted(ARLevel _startedLevel) { LevelStarted?.Invoke(_startedLevel); }