Пример #1
0
        protected virtual void Awake()
        {
            _meshRenderer = GetComponent <MeshRenderer>();
            _boxCollider  = GetComponent <BoxCollider>();
            _animation    = GetComponentInChildren <Animation>(true);
            _isVisible    = _meshRenderer.isVisible;

            if (_isVisible)
            {
                OnBecameVisible.SafeInvoke(this);
            }

            SetupPoints();
        }
Пример #2
0
        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);
        }
Пример #3
0
        protected virtual void Update()
        {
            if (_meshRenderer.isVisible != _isVisible)
            {
                _isVisible = _meshRenderer.isVisible;

                if (_isVisible)
                {
                    OnLineBecameVisible();
                    OnBecameVisible.SafeInvoke(this);
                }
                else
                {
                    OnLineBecameInvisible();
                    OnBecameInvisible.SafeInvoke(this);
                }
            }
        }