Exemple #1
0
        public void Switch(FlashLightActiveType flashState)
        {
            switch (flashState)
            {
            case FlashLightActiveType.On:
                _light.enabled     = true;
                Transform.position = _goFollow.position + _vecOffset;
                Transform.rotation = _goFollow.rotation;
                State = FlashLightActiveType.On;
                break;

            case FlashLightActiveType.Off:
                _light.enabled = false;
                State          = FlashLightActiveType.Off;
                break;

            case FlashLightActiveType.Charging:
                _light.enabled = false;
                State          = FlashLightActiveType.Charging;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(flashState), flashState, null);
            }
        }
Exemple #2
0
        public void Switch(FlashLightActiveType value)
        {
            switch (value)
            {
            case FlashLightActiveType.On:
                _light.enabled     = true;
                Transform.position = _goFollow.position + _vectorOffset;
                Transform.rotation = _goFollow.rotation;
                break;

            case FlashLightActiveType.Off:
                _light.enabled = false;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(value), value, null);
            }
        }