Inheritance: MonoBehaviour
Exemple #1
0
        // target spot lights only and configure them per the settings
        public static void Postfix(LightSpawner __instance, BTLight ___spawnedLight)
        {
            if (__instance.type == LightSpawner.LightTypes.point)
            {
                return;
            }

            Log($"adjusting: {__instance.name} ({__instance.transform.parent.name})");
            if (settings.ExtraRange)
            {
                ___spawnedLight.radius = extraRadius;
            }

            if (settings.Intensity != "VANILLA" &&
                IntensityMap.ContainsKey(settings.Intensity))
            {
                if (__instance.name.StartsWith("light"))
                {
                    // magic numbers.. sorry.  adjusted to visuals
                    ___spawnedLight.intensity           = IntensityMap[settings.Intensity] / 5f;
                    ___spawnedLight.spotlightAngleOuter = settings.Angle * 1.20f;
                }
                else
                {
                    ___spawnedLight.intensity           = IntensityMap[settings.Intensity];
                    ___spawnedLight.spotlightAngleOuter = settings.Angle;
                }
            }
        }
 // Use this for initialization
 void Start()
 {
     myRigidbody           = transform.GetComponent <Rigidbody2D> ();
     posX                  = transform.position.x;
     myChallengeController = GameObject.FindObjectOfType <ChallengeController> ();
     myGameController      = GameObject.FindObjectOfType <GameController> ();
     ls            = GameObject.FindObjectOfType <LightSpawner> ();
     myAudioSource = GameObject.FindObjectOfType <AudioSource> ();
     anim          = GetComponent <Animator> ();
 }
 private void GetSpawners()
 {
     swarmSpawner = GameObject.Find("SwarmSpawner").GetComponent <SwarmSpawner>();
     gridSpawner  = GameObject.Find("GridSpawner").GetComponent <GridSpawner>();
     lightSpawner = GameObject.Find("LightSpawner").GetComponent <LightSpawner>();
 }
Exemple #4
0
 private void Start()
 {
     ls = GameObject.Find("Origin").GetComponent <LightSpawner>();
 }