Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        spotLight             = new SpotLightParam();
        spotLight.position    = transform.position;
        spotLight.color       = Color.white;
        spotLight.range       = 3f;
        spotLight.direction   = transform.eulerAngles.z * Mathf.PI / 180f;
        spotLight.angle       = 70f * Mathf.PI / 180f;
        spotLight.centerAngle = 30f * Mathf.PI / 180f;

        LightManager lm = Camera.main.GetComponent <LightManager>();

        lm.AddSpotLight(spotLight);
    }
Beispiel #2
0
 /// <summary>
 /// 增加聚光灯
 /// </summary>
 /// <param name="light">光源参数</param>
 public void AddSpotLight(SpotLightParam light)
 {
     spotLights.Add(light);
 }
Beispiel #3
0
 /// <summary>
 /// 移除聚光灯
 /// </summary>
 /// <param name="light"></param>
 public void RemoveSpotLight(SpotLightParam light)
 {
     spotLights.Remove(light);
 }