예제 #1
0
 /// <summary>This function gets called by <see cref="OnProtoDeserialize(ProtobufSerializer)"/> when game loads. It restores light state of current base or submarine.</summary>
 public void RestoreLightState()
 {
     if (_lightSwitchSubRoot != null)
     {
         _lightSwitchSubRoot.ForceLightingState(this.IsLightsOn);
     }
 }
예제 #2
0
 internal void ToggleHabitatLights()
 {
     if (_currentSub != null)
     {
         if (_mono.IsConstructed)
         {
             bool result = (bool)_subLights.GetValue(_currentSub);
             _currentSub.ForceLightingState(!result);
         }
     }
 }
예제 #3
0
        /// <summary>This function gets called by <see cref="Awake"/> method. It restores light state of current base or submarine.</summary>
        public void RestoreLightState()
        {
            if (!enabled)
            {
                return;
            }

            // Get current base/cyclops and restore its lights state
            SubRoot subRoot = GetComponent <SubRoot>();

            if (subRoot != null)
            {
                subRoot.ForceLightingState(this.IsLightsOn);
            }
        }