protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling) { base.DidActivate(firstActivation, addedToHierarchy, screenSystemEnabling); name = nameof(MirrorViewController); if (addedToHierarchy) { Transform screenSystem = GameObject.Find("Wrapper/ScreenSystem").transform; _mirrorContainer = new GameObject("Mirror Container"); _mirrorContainer.transform.SetParent(screenSystem, false); _mirrorContainer.transform.position = new Vector3(0, _floorController.floorPosition, 0); Vector2 mirrorSize = _settings.mirror.size; _mirrorHelper.CreateMirror(new Vector3(0, mirrorSize.y / 2, 2.6f), Quaternion.Euler(-90f, 0, 0), mirrorSize, _mirrorContainer.transform); _avatarManager.avatarStartedLoading += OnAvatarStartedLoading; _avatarManager.avatarChanged += OnAvatarChanged; _avatarManager.avatarLoadFailed += OnAvatarLoadFailed; _floorController.floorPositionChanged += OnFloorPositionChanged; SetLoading(false); } }
protected override void DidActivate(bool firstActivation, ActivationType activationType) { base.DidActivate(firstActivation, activationType); if (activationType == ActivationType.AddedToHierarchy) { _mirrorContainer = new GameObject(); Vector2 mirrorSize = _settings.mirror.size; _mirrorHelper.CreateMirror(new Vector3(0, mirrorSize.y / 2, 3f) + _settings.mirror.positionOffset, Quaternion.Euler(-90f, 0, 0), mirrorSize, _mirrorContainer.transform, new Vector3(0, mirrorSize.y / 2, 1.5f)); } }
#pragma warning restore IDE0051 #endregion protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling) { base.DidActivate(firstActivation, addedToHierarchy, screenSystemEnabling); if (addedToHierarchy) { _mirrorContainer = new GameObject("Mirror Container"); Vector2 mirrorSize = _settings.mirror.size; _mirrorHelper.CreateMirror(new Vector3(0, mirrorSize.y / 2, 2), Quaternion.Euler(-90f, 0, 0), mirrorSize, _mirrorContainer.transform); _avatarManager.avatarStartedLoading += OnAvatarStartedLoading; _avatarManager.avatarChanged += OnAvatarChanged; SetLoading(false); } }