コード例 #1
0
 private void HandlePillarVisibilityChange(VisibilityState_old newState)
 {
     if (newState == VisibilityState_old.visible)
     {
         ObscurePillar.activePillar = this;
     }
 }
コード例 #2
0
        public void SetVisibilityState(VisibilityState_old newState)
        {
            visibilityState = newState;
            UpdateVisibilitySettings();

            if (OnVisibilityStateChange != null)
            {
                OnVisibilityStateChange(newState);
            }
        }
コード例 #3
0
        void OnEnable()
        {
            initialLayer = gameObject.layer;
            thisRenderer = gameObject.GetComponent <EpitaphRenderer>();
            if (thisRenderer == null)
            {
                thisRenderer = gameObject.AddComponent <EpitaphRenderer>();
            }
            oppositeStartingVisibilityState = startingVisibilityState == VisibilityState_old.visible ? VisibilityState_old.invisible : VisibilityState_old.visible;

            if (!setMaterialColorOnStart && setMaterialColorOnStateChange)
            {
                Material startingMaterial = thisRenderer.GetMaterial();
                materialColor = startingMaterial.GetColor(EpitaphRenderer.mainColor);
                emissiveColor = startingMaterial.GetColor(emissiveColorKey);
            }

            ObscurePillar.OnPlayerMoveAroundPillar += HandlePlayerMoveAroundPillar;
            ObscurePillar.OnActivePillarChanged    += HandlePillarChanged;
            ObscurePillar.OnActivePillarChanged    += ResetVisibilityStateIfPartiallyVisible;
        }