summaryrefslogtreecommitdiff
path: root/Runtime/Export/UnityEngineLight.txt
blob: 5880e5899edab8ba423b15e7d497c4aa3aa178a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
C++RAW

#include "UnityPrefix.h"
#include "Configuration/UnityConfigure.h"
#include "Runtime/Camera/Camera.h"
#include "Runtime/Camera/Light.h"
#include "Runtime/Camera/Skybox.h"
#include "Runtime/Graphics/LightmapSettings.h"
#include "Runtime/Filters/Renderer.h"
#include "Runtime/Camera/IntermediateRenderer.h"
#include "Runtime/Graphics/Transform.h"
#include "Runtime/Shaders/Material.h"
#include "Runtime/Filters/Misc/TextMesh.h"
#include "Runtime/Shaders/Shader.h"
#include "Runtime/Scripting/ScriptingUtility.h"
#include "Runtime/Camera/LightManager.h"
#include "Runtime/Misc/QualitySettings.h"
#include "Runtime/Camera/RenderSettings.h"
#include "Runtime/Mono/MonoBehaviour.h"
#include "Runtime/Scripting/ScriptingExportUtility.h"

#include <list>
#include <vector>

CSRAW
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Collections;

namespace UnityEngine
{

// Script interface for [[wiki:class-Light|light components]].
CLASS Light : Behaviour
	// The type of the light.
	AUTO_PROP LightType type GetType SetType

	// The color of the light.
	AUTO_PROP Color color GetColor SetColor

	// The Intensity of a light is multiplied with the Light color.
	AUTO_PROP float intensity GetIntensity SetIntensity
	
	// How this light casts shadows?
	AUTO_PROP LightShadows shadows GetShadows SetShadows
	
	
	// Strength of light's shadows
	AUTO_PROP float shadowStrength GetShadowStrength SetShadowStrength
	
	
	// Shadow mapping bias
	AUTO_PROP float shadowBias GetShadowBias SetShadowBias


	// Softness of directional light's soft shadows
	AUTO_PROP float shadowSoftness GetShadowSoftness SetShadowSoftness
	
	
	// Fadeout speed of directional light's soft shadows
	AUTO_PROP float shadowSoftnessFade GetShadowSoftnessFade SetShadowSoftnessFade
	

	
	// The range of the light.
	AUTO_PROP float range GetRange SetRange

	// The angle of the light's spotlight cone in degrees.
	AUTO_PROP float spotAngle GetSpotAngle SetSpotAngle

	AUTO_PROP float cookieSize GetCookieSize SetCookieSize
	
	// The cookie texture projected by the light.
	AUTO_PTR_PROP Texture cookie GetCookie SetCookie
	
	// The [[wiki:class-Flare|flare asset]] to use for this light.
	AUTO_PTR_PROP Flare flare GetFlare SetFlare
	
	// How to render the light.
	AUTO_PROP LightRenderMode renderMode GetRenderMode SetRenderMode

	// Has the light been already lightmapped.
	AUTO_PROP bool alreadyLightmapped GetActuallyLightmapped SetActuallyLightmapped
	

	// This is used to light certain objects in the scene selectively.
	AUTO_PROP int cullingMask GetCullingMask SetCullingMask
	
	// The size of the area light. Editor only.
	CONDITIONAL UNITY_EDITOR
	AUTO_PROP Vector2 areaSize GetAreaSize SetAreaSize

	FLUSHCONDITIONS

	CSRAW
#if UNITY_EDITOR
	OBSOLETE warning Use QualitySettings.pixelLightCount instead.
#endif
	CUSTOM_PROP static int pixelLightCount { return GetQualitySettings().GetCurrent().pixelLightCount; } { GetQualitySettings().SetPixelLightCount(value); }
	
	//*undocumented For terrain engine only
	CUSTOM public static Light[] GetLights (LightType type, int layer)
	{
		UNITY_TEMP_VECTOR(Light*) lightsvector;
			
		layer = 1 << layer;
		LightManager::Lights& lights = GetLightManager().GetAllLights();
		for (LightManager::Lights::iterator i=lights.begin();i != lights.end();i++)
		{
			Light* light = &*i;
			if (!light)
				continue;
			if (light->GetType() == type && (light->GetCullingMask() & layer) != 0)
				lightsvector.push_back(light);
		}
		
		return CreateScriptingArrayFromUnityObjects(lightsvector,Scripting::ClassIDToScriptingType(ClassID(Light)));
	}
	
	OBSOLETE error light.shadowConstantBias was removed, use light.shadowBias
	CSRAW public float shadowConstantBias { get { return 0.0f; } set {} }
	
	OBSOLETE error light.shadowObjectSizeBias was removed, use light.shadowBias
	CSRAW public float shadowObjectSizeBias { get { return 0.0f; } set {} }
	
	OBSOLETE error light.attenuate was removed; all lights always attenuate now
	CSRAW public bool attenuate { get { return true; } set {} }
	
END


CSRAW }