Ejemplo n.º 1
0
 void Update()
 {
     if (Input.GetMouseButtonDown(1))
     {
         darkform.SetActive(true);
         Lamp lamp = Lamp.GetComponent <Lamp>();
         if (lamp != null)
         {
             lamp.ActivateShadow();
         }
         Lamp.SetActive(false);
         PlayerAnimation.GetComponent <SpriteRenderer>().enabled = false;
     }
     if (Input.GetMouseButtonUp(1))
     {
         darkform.SetActive(false);
         Lamp.SetActive(true);
         Lamp lamp = Lamp.GetComponent <Lamp>();
         if (lamp != null)
         {
             lamp.DeactivateShadow();
         }
         PlayerAnimation.GetComponent <SpriteRenderer>().enabled = true;
     }
 }
Ejemplo n.º 2
0
 private void ToggleShadow(bool active)
 {
     if (shadowActive != active)
     {
         shadowActive = active;
         if (shadowActive)
         {
             lamp.ActivateShadow();
         }
         else
         {
             lamp.DeactivateShadow();
         }
     }
 }