public void InitLightType()
        {
            switch (UnityLight.type)
            {
            case UnityEngine.LightType.Directional:
                LightType = ELightType.Directional;
                break;

            case UnityEngine.LightType.Point:
                LightType = ELightType.Point;
                break;

            case UnityEngine.LightType.Spot:
                LightType = ELightType.Spot;
                break;

            case UnityEngine.LightType.Disc:
                LightType = ELightType.Spot;
                break;

            case UnityEngine.LightType.Rectangle:
                LightType = ELightType.Rect;
                break;
            }
        }
 public void RemoveLight(int index, ELightType lightType)
 {
     if (lightType == ELightType.Directional)
     {
         if (index >= 0 && index < m_directionalLights.Count)
         {
             m_directionalLights.RemoveAt(index);
         }
     }
     else if (lightType == ELightType.Ambient)
     {
         if (index >= 0 && index < m_ambientLights.Count)
         {
             m_ambientLights.RemoveAt(index);
         }
     }
     else
     {
         if (index >= 0 && index < m_positionalLights.Count)
         {
             m_positionalLights[index].Dispose();
             m_positionalLights.RemoveAt(index);
         }
     }
 }
        public static ELightState GetLightState(ELightType light)
        {
            return Gpio.Controller.Pin(light.GetGpioPin()).Read() == GpioPinValue.High
                ? ELightState.TurnOn
                : ELightState.TurnOff;


        }
Exemple #4
0
 public Meta(EBodyType eBody, ELensType eLens, ELightType eLight)
 {
     scnt++;
     seq   = scnt;
     Body  = eBody;
     Lens  = eLens;
     Light = eLight;
 }
Exemple #5
0
        public static void Main(string[] args)
        {
            EBodyType  bodyType  = EBodyType.EH_BA;
            ELensType  lensType  = ELensType.EH_L1;
            ELightType lightType = ELightType.LT_CLEAR;

            PictureFile pictureFile  = new PictureFile("사진", bodyType, lensType, lightType);
            PictureFile pictureFile2 = new PictureFile("사진", bodyType, lensType, lightType);

            pictureFile.View();
            pictureFile2.View();
        }
 public static Uri GetLightIconUri(ELightType lightType)
 {
     switch (lightType)
     {
         case ELightType.PeterRoomMainLight:
             return new Uri("ms-appx:///Assets/Icons/Lights/appbar.lamp.variant.png");
         case ELightType.PeterRoomBedsideLamp:
             return new Uri("ms-appx:///Assets/Icons/Lights/appbar.lamp.png");
         case ELightType.LivingRoomLamp:
             return new Uri("ms-appx:///Assets/Icons/Lights/appbar.lamp.desk.png");
         default:
             throw new ArgumentOutOfRangeException(nameof(lightType), lightType, null);
     }
 }
Exemple #7
0
        public Meta MakeMeta(EBodyType bodyType, ELensType lensType, ELightType lightType)
        {
            foreach (var meta in metas)
            {
                if (meta.isEqual(bodyType, lensType, lightType))
                {
                    return(meta);
                }
            }

            Meta m = new Meta(bodyType, lensType, lightType);

            metas.Add(m);
            return(m);
        }
 public static void ChangeLightState(ELightType light, ELightState state)
 {
     Gpio.Controller.Pin(light.GetGpioPin()).Write(state == ELightState.TurnOn ? GpioPinValue.High : GpioPinValue.Low);
 }
 public static void TurnOffLight(ELightType light)
 {
     Gpio.Controller.Pin(light.GetGpioPin()).Write(GpioPinValue.Low);
 }
Exemple #10
0
        public PictureFile(string name, EBodyType bodyType, ELensType lensType, ELightType lightType)
        {
            MetaPool meta_pool = MetaPool.Singleton;

            meta = meta_pool.MakeMeta(bodyType, lensType, lightType);
        }
Exemple #11
0
 public bool isEqual(EBodyType bodyType, ELensType lensType, ELightType lightType)
 {
     return((bodyType == Body) && (lensType == Lens) && (Light == lightType));
 }