protected virtual void Awake() { _meshRenderer = GetComponent <MeshRenderer>(); _boxCollider = GetComponent <BoxCollider>(); _animation = GetComponentInChildren <Animation>(true); _isVisible = _meshRenderer.isVisible; if (_isVisible) { OnBecameVisible.SafeInvoke(this); } SetupPoints(); }
public StackViewLayout(Transform layout, IBackgroundView background) { _background = background; Layout = layout; OnClosed.Where(x => x == _activeView) .Subscribe(HideView) .AddTo(LifeTime); OnBecameHidden.Where(x => x == _activeView) .Subscribe(HideView) .AddTo(LifeTime); OnBecameVisible.Where(x => x != _activeView) .Subscribe(ActivateView) .AddTo(LifeTime); }
protected virtual void Update() { if (_meshRenderer.isVisible != _isVisible) { _isVisible = _meshRenderer.isVisible; if (_isVisible) { OnLineBecameVisible(); OnBecameVisible.SafeInvoke(this); } else { OnLineBecameInvisible(); OnBecameInvisible.SafeInvoke(this); } } }