Beispiel #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();
        }
Beispiel #2
0
        protected virtual void Update()
        {
            if (_meshRenderer.isVisible != _isVisible)
            {
                _isVisible = _meshRenderer.isVisible;

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