コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        float velocity = 0;
        float radius   = lightMask.Radius;

        if (Time.time > flickerTime)
        {
            /*if(radius >= maxRadius)
             *  radius = Mathf.SmoothDamp(radius, 0, ref velocity, FlickerCooldown);
             * else if(radius <= 0)
             *  radius = Mathf.SmoothDamp(radius, maxRadius, ref velocity, FlickerCooldown);*/
            lightMask   = LightManager.Instance.CreateLight(transform.position, LightPower);
            flickerTime = Time.time + FlickerCooldown;
        }
    }
コード例 #2
0
ファイル: LightManager.cs プロジェクト: pgpais/ManBat
 public void DestroyLight(LightMask light)
 {
     _objectPool.DestroyObject(light);
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     lightMask   = LightManager.Instance.CreateLight(transform.position, LightPower);
     flickerTime = Time.time + FlickerCooldown;
 }
コード例 #4
0
ファイル: MLibraryV2.cs プロジェクト: thedeaths/mir2
 public Bitmap GetLightImage()
 {
     if (LightImage == null)
     {
         LightMask Mask = new LightMask(Image);
         LightImage = Mask.Image;
         if (LightImage != null)
         {
             LightWidth = (short)Mask.Image.Width;
             LightHeight = (short)Mask.Image.Height;
             LightColor = AverageColorFromTexture();
             LightX = (short)(Mask.OffsetX + X);
             LightY = (short)(Mask.OffsetY + Y);
             //LightFBytes = ConvertBitmapToArray(Mask.Image);
         }
         else
         {
             LightWidth = 0;
             LightHeight = 0;
             LightFBytes = new byte[0];
             LightColor = Color.White;
         }
         Mask = null;
     }
     
     return LightImage;
 }