private void reloadLight() { var LightingObjects = GameObject.FindGameObjectsWithTag("Lighting"); // Debug.Log("Mask Update LightingObjects.Count=" + LightingObjects.Length); List <Vector4> pointLights = new List <Vector4>(); int pointCount = 0; List <Vector4> lineLights = new List <Vector4>(); int lineCount = 0; // Debug.Log("Screen.width=" + Screen.width + ",Screen.height=" + Screen.height); var asW = Screen.width / 1080f; var asH = Screen.height / 1920f; foreach (var obj in LightingObjects) { Shining sh = obj.gameObject.GetComponent <Shining>(); if (sh.LightShape == 1 && sh.P1 > 0) { // Debug.Log("Lighting if Object Name=" + obj.name); pointLights.Add(sh.GetPointLightInfo()); pointCount++; } else if (sh.LightShape == 2 && sh.P1 > 0) { // Debug.Log("Lighting else if Object Name=" + obj.name); foreach (var e in sh.GetLineLightList()) { // Debug.Log("Lighting Object Name=" + obj.name + ",e=" + e); lineLights.Add(e); lineCount++; } } else { // Debug.Log("Lighting else Object Name=" + obj.name); } } for (int i = pointCount; i < 30; i++) { pointLights.Add(new Vector4()); } for (int i = lineCount; i < 90; i++) { lineLights.Add(new Vector4()); } spriteRenderer.material.SetFloat("_Alpha", spriteRenderer.color.a); spriteRenderer.material.SetVectorArray("_LightingArr", pointLights); spriteRenderer.material.SetFloat("_LightingArrLen", pointCount); spriteRenderer.material.SetFloat("_LineLightingArrLen", lineCount); if (lineLights.Count > 0) { // Debug.Log("Lighting lineLights.Count=" + lineLights.Count + ",lineCount=" + lineCount); spriteRenderer.material.SetVectorArray("_LineLightingArr", lineLights); } }
public void MetalShining() { switch (state) { case Shining.Init: { Image.color = new Color(1, 1, 1, 0); } break; case Shining.Hide: { Timer += Time.deltaTime; Image.color += new Color(0, 0, 0, 0.3f); if (Timer > 0.2f) { state = Shining.Show; Timer = 0f; } } break; case Shining.Show: { Timer += Time.deltaTime; Image.color -= new Color(0, 0, 0, 0.3f); if (Timer > 0.6f) { Image.color = new Color(1, 1, 1, 0); state = Shining.Hide; Timer = 0f; } } break; } }
public Arrow(Vector2 location, SpriteBatch batch) { this.location = location; spriteBatch = batch; this.sprite = ItemFactory.Instance.CreateArrowSprite(); }
public Fairy(Vector2 location, SpriteBatch batch) { this.location = location; this.sprite = ItemFactory.Instance.CreateFariySprite(); this.spriteBatch = batch; }
public Rupy(Vector2 location, SpriteBatch batch) { this.location = location; this.sprite = ItemFactory.Instance.CreateRupySprite(); spriteBatch = batch; }
public Clock(Vector2 location, SpriteBatch batch) { this.location = location; spriteBatch = batch; sprite = ItemFactory.Instance.CreateClockSprite(); }
public OldMan(Vector2 location, SpriteBatch batch) { this.location = location; spriteBatch = batch; sprite = ItemFactory.Instance.CreateOldManSprite(); }
public HeartContainer(Vector2 location, SpriteBatch batch) { this.location = location; spriteBatch = batch; sprite = ItemFactory.Instance.CreateHeartConttainerSprite(); }
public Triforce(Vector2 location, SpriteBatch batch) { this.location = location; spriteBatch = batch; sprite = ItemFactory.Instance.CreateTriforceSprite(); }
public Sword(Vector2 location, SpriteBatch batch) { this.location = location; spriteBatch = batch; this.sprite = ItemFactory.Instance.CreateSwordSprite(); }
public Metal(Image imageMetal) { Image = imageMetal; Timer = 0f; state = Shining.Init; }
public Compass(Vector2 location, SpriteBatch batch) { sprite = ItemFactory.Instance.CreateCompassSprite(); this.location = location; spriteBatch = batch; }