本文整理汇总了C#中Light类的典型用法代码示例。如果您正苦于以下问题:C# Light类的具体用法?C# Light怎么用?C# Light使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Light类属于命名空间,在下文中一共展示了Light类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Chronic
public Chronic(string name, Water water, Light light, Food food)
: this(name)
{
Water = water;
Light = light;
Food = food;
}
开发者ID:Sjnuffel,项目名称:GanjaLibrary,代码行数:7,代码来源:ChronicVariables.cs
示例2: Start
void Start()
{
pointLight = GetComponent<Light>();
startColor = pointLight.color;
anchorManager = ImportExportAnchorManager.Instance;
}
开发者ID:thelegend6420,项目名称:holograms-240,代码行数:7,代码来源:SetStatusColor.cs
示例3: Start
void Start ()
{
mainLight = GetComponent<Light>();
skyMat = RenderSettings.skybox;
}
开发者ID:Stumpstump,项目名称:RoverGame,代码行数:7,代码来源:AutoIntensity.cs
示例4: Start
void Start()
{
ThisBody = GetComponent<Rigidbody2D>();
Anim = GetComponent<Animator>();
TailLight = Light.GetComponent<Light>();
// SpriteRen = GetComponent<SpriteRenderer>();
}
开发者ID:JasonSlingsCode,项目名称:CNR,代码行数:7,代码来源:HealthScript.cs
示例5: Update
// Update is called once per frame
void Update()
{
if(myLight == null){
myLight = GetComponentInChildren<Light>();
}else{
if(myLight.intensity>0){//light is on
if(goingToGoal){
if(Vector3.Distance(goal,transform.position)>0.5f){
transform.parent.position = (goal-transform.parent.position)*speed + transform.parent.position;
//transform.position = (goal-transform.position)*speed + transform.position;
}else{
goingToGoal = false;
}
}else{
if(Vector3.Distance(original,transform.position)>0.5f){
transform.parent.position = (original-transform.parent.position)*speed + transform.parent.position;
//transform.position = (original-transform.position)*speed + transform.position;
}else{
goingToGoal = true;
}
}
}else{//light is off
}
}
}
开发者ID:yenv672,项目名称:thesis,代码行数:28,代码来源:moving.cs
示例6: Start
//AudioSource gunShot;
void Start()
{
shootableMask = LayerMask.GetMask ("Shootable");
gunLight = GetComponent <Light> ();
anim = GetComponent<Animator>();
}
开发者ID:selu285-2015,项目名称:285_02_FA15G2,代码行数:8,代码来源:Glock.cs
示例7: Awake
/// <summary>
/// Find all needed components.
/// </summary>
void Awake ()
{
mWidget = GetComponentInChildren<UIWidget>();
Renderer ren = renderer;
if (ren != null) mMat = ren.material;
mLight = light;
}
开发者ID:huw12313212,项目名称:Virtual-Piano,代码行数:11,代码来源:TweenColor.cs
示例8: PulseLightSize
private IEnumerator PulseLightSize(Light light, float minSize, float maxSize, float time, bool repeating = false)
{
light.range = minSize;
float timer = 0;
float frameRate = Time.frameCount/Time.time;
float step = (maxSize - minSize)/frameRate;
while (timer < time/2.0f) {
light.range += step;
timer += Time.deltaTime;
yield return new WaitForEndOfFrame();
}
light.range = maxSize;
while (timer < time) {
light.range -= step;
timer += Time.deltaTime;
yield return new WaitForEndOfFrame();
}
light.range = minSize;
if (repeating) {
beginBlinkingCoroutine();
}
}
开发者ID:imann24,项目名称:VR,代码行数:26,代码来源:FinishController.cs
示例9: Awake
/* METHODES */
//Constructor
void Awake()
{
// A retenir : GemLight = gameObject.AddComponent("Light") as Light;
//Lien avec les composants des particules
GemPartEmitter = GetComponent<ParticleEmitter>(); //Lien avec l'Emitter des particules
GemPartAnimation = GetComponent<ParticleAnimator>(); //Lien avec l'Animator des particules
//GemPartRenderer = GetComponent<ParticleRenderer>(); //Lien avec le Renderer des particules
InitialColor = Color.yellow; //Définition de la couleur initiale de la Gemme
OppositeColor = Color.magenta; //Définition de la couleur opposé de la Gemme
//Initialisation du tableau dynamiquement
GemPartStarkle = new Color[5]; //Initialisation des 5 couleurs comosant le Renderer
//Lien avec la Lumière
GemLight = GetComponent<Light>();
GemTitle = GameObject.Find("GUI Text"); //Lien avec le GUIText de la scène
//Initialisation des statuts
GemPartEmitter.emit = false; //Dissimulation des particules
GemTitle.guiText.enabled = false; //Dissimulation du texte
MyPart = (ParticleSystem) Instantiate(test);
ChangeMode = false;
}
开发者ID:BenjaminDo,项目名称:Enclave,代码行数:28,代码来源:GeneralGemstone.cs
示例10: Start
void Start()
{
myLight = GetComponentInChildren<Light>();
particles = GetComponentInChildren<ParticleSystem>();
particles.enableEmission = true;
myLight.intensity = 2;
}
开发者ID:Gotyn,项目名称:WHICH,代码行数:7,代码来源:LightPost.cs
示例11: Start
// Use this for initialization
void Start()
{
// set animation
this.animation = GetComponent<Animation> ();
// set fire ligth
this.fireLigth = this.effects.GetComponent<Light> ();
}
开发者ID:leds-guarapari,项目名称:terravermelha,代码行数:8,代码来源:AnimationFPSControllerScript.cs
示例12: Start
// Use this for initialization
void Start()
{
contadorNiveles = contadorNiveles - 1;
l = GetComponentInChildren<Light>();
Nivel = this.gameObject;
nivel -= 1;
l.enabled = false;
levelPanel = Instantiate(levelInfoPrefab);
levelPanel.transform.SetParent(canvas.transform, false);
levelPanel.transform.position = new Vector3(transform.position.x, transform.position.x, transform.position.z);
//levelPanel.GetComponentInChildren<Text>().text = Nivel.name;
levelPanel.GetComponentInChildren<Text>().text = levelName;
if(ruta){
ruta.GetComponentsInChildren<LightSwitch>();
}
if(OneReset){
for(i=0;i<cantidadNiveles;i++){
completado[i] = false;
}
OneReset = false;
}
}
开发者ID:GearsOfTheSkyDevelopmentTeam,项目名称:Proyecto-FORMULA,代码行数:26,代码来源:LightSwitch.cs
示例13: SetPlayerIndex
public void SetPlayerIndex(int networkId)
{
/*
switch(networkId){
case 1: playerIndex = 3;break;
case 2: playerIndex = 1;break;
case 3: playerIndex = 2;break;
}
*/
playerIndex = networkId;
helmetLight = GetComponent<Light>(); //Calls the light component on the spotlight
//Set the color of the interactable button both background light and particles to the correct user.
switch (playerIndex){
case 1:
helmetLight.color = new Color(0.2F, 0.2F, 1, 1F); //blue
nonFocusedHelmetLight.color = new Color(0.2F, 0.2F, 1, 1F); //blue
break;
case 2:
helmetLight.color = new Color(1, 0.2F, 0.2F, 1F); //red
nonFocusedHelmetLight.color = new Color(1, 0.2F, 0.2F, 1F); //red
break;
case 3:
helmetLight.color = new Color(0.2F, 1, 0.2F, 1F); //green
nonFocusedHelmetLight.color = new Color(0.2F, 1, 0.2F, 1F); //green
break;
default:
Debug.Log("Invalid playerIndex");
break;
}
}
开发者ID:Jalict,项目名称:MED5-PGP-P1,代码行数:32,代码来源:HelmetLightScript.cs
示例14: onFlightStart
protected override void onFlightStart()
{
ping = gameObject.AddComponent<AudioSource>();
WWW www = new WWW("file://" + KSPUtil.ApplicationRootPath.Replace("\\", "/") + "Parts/mumech_MuonDetector/ping.wav");
if ((ping != null) && (www != null))
{
ping.clip = www.GetAudioClip(false);
ping.volume = 0;
ping.Stop();
}
disk = transform.Find("model/disk");
if (disk != null)
{
MIN_PING_DIST = 150000;
MIN_PING_TIME = 0.2;
MAX_PING_TIME = 15;
led = transform.Find("model/led");
originalLensShader = led.renderer.material.shader;
pingLight = led.gameObject.AddComponent<Light>();
pingLight.type = LightType.Point;
pingLight.renderMode = LightRenderMode.ForcePixel;
pingLight.shadows = LightShadows.None;
pingLight.range = 1;
pingLight.enabled = false;
}
RenderingManager.AddToPostDrawQueue(3, new Callback(drawGUI));
}
开发者ID:Majiir,项目名称:MuMechLib,代码行数:30,代码来源:MuonDetector.cs
示例15: Awake
/// <summary>
///
/// </summary>
void Awake()
{
m_Transform = transform;
// the muzzleflash is meant to use the 'Particles/Additive'
// (unity default) shader which has the 'TintColor' property
m_Color = renderer.material.GetColor("_TintColor");
m_Color.a = 0.0f;
m_ForceShow = false;
// if a light is present in the prefab we will cache and use it
m_Light = light;
if (m_Light != null)
{
m_LightIntensity = m_Light.intensity;
m_Light.intensity = 0.0f;
}
m_Renderer = renderer;
if (m_Renderer != null)
m_Material = renderer.material;
}
开发者ID:Barthuc,项目名称:ProjectLevelDesign,代码行数:28,代码来源:vp_MuzzleFlash.cs
示例16: _UpdateColor
private static void _UpdateColor(Light obj, LightPropertyType pType, float val)
{
Color c = obj.color;
switch(pType) {
case LightPropertyType.Color_R:
c.r = val;
break;
case LightPropertyType.Color_G:
c.g = val;
break;
case LightPropertyType.Color_B:
c.b = val;
break;
case LightPropertyType.Color_RGB:
c.r = val;
c.g = val;
c.b = val;
break;
case LightPropertyType.Color_A:
c.a = val;
break;
}
obj.color = c;
}
开发者ID:8monolith8,项目名称:fuze-vj-kit,代码行数:25,代码来源:VJLightPropertyHelper.cs
示例17: Add
/// <summary>
/// 增加一条数据
/// </summary>
public void Add(Light.Model.marriageimageinfo model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into marriageimageinfo(");
strSql.Append("id,url,marriageid,createman,createtime");
strSql.Append(") values (");
strSql.Append("@id,@url,@marriageid,@createman,@createtime");
strSql.Append(") ");
MySqlParameter[] parameters = {
new MySqlParameter("@id", MySqlDbType.Int32,10) ,
new MySqlParameter("@url", MySqlDbType.VarChar,500) ,
new MySqlParameter("@marriageid", MySqlDbType.Int32,10) ,
new MySqlParameter("@createman", MySqlDbType.Int32,10) ,
new MySqlParameter("@createtime", MySqlDbType.DateTime)
};
parameters[0].Value = model.id;
parameters[1].Value = model.url;
parameters[2].Value = model.marriageid;
parameters[3].Value = model.createman;
parameters[4].Value = model.createtime;
DbHelperMySQL.ExecuteSql(strSql.ToString(),parameters);
}
开发者ID:seven7610,项目名称:light,代码行数:28,代码来源:marriageimageinfo.cs
示例18: _UpdateColorRelative
private static void _UpdateColorRelative(Light obj, LightPropertyType pType, float val)
{
Color c = obj.color;
switch(pType) {
case LightPropertyType.Color_R_Relative:
c.r = Mathf.Clamp01(c.r + val);
break;
case LightPropertyType.Color_G_Relative:
c.g = Mathf.Clamp01(c.g + val);
break;
case LightPropertyType.Color_B_Relative:
c.b = Mathf.Clamp01(c.b + val);
break;
case LightPropertyType.Color_RGB_Relative:
c.r = Mathf.Clamp01(c.r + val);
c.g = Mathf.Clamp01(c.g + val);
c.b = Mathf.Clamp01(c.b + val);
break;
case LightPropertyType.Color_A_Relative:
c.a = Mathf.Clamp01(c.a + val);
break;
}
obj.color = c;
}
开发者ID:8monolith8,项目名称:fuze-vj-kit,代码行数:25,代码来源:VJLightPropertyHelper.cs
示例19: CreateFlare
private void CreateFlare() {
Light[] lights = gameObject.GetComponentsInChildren<Light>();
Arguments.ValidateNotNullOrEmpty<Light>(lights);
int lightCount = lights.Length;
if (lightCount == 1) {
// there is only the primary light attached, so I need to create another for the flare
// avoid getting the flareLight prefab with Resources.Load("Lights/FlareLight")
_flareLight = Instantiate<Light>(UsefulPrefabs.Instance.flareLight);
//_flareLight.transform.parent = _transform;
UnityUtility.AttachChildToParent(_flareLight.gameObject, _transform.gameObject);
//float radiusOfStar = (gameObject.GetSafeMonoBehaviourComponentInParents<Star>().collider as SphereCollider).radius;
float radiusOfStar = (gameObject.GetSafeMonoBehaviourComponentInParents<StarView>().collider as SphereCollider).radius;
Vector3 flareLightLocationBehindStar = Vector3.forward * (radiusOfStar + 2F);
_flareLight.transform.localPosition = flareLightLocationBehindStar;
}
else if (lightCount == 2) {
_flareLight = lights[1];
}
else {
D.Warn("There are more lights attached than needed: {0}".Inject(lightCount));
_flareLight = lights[1];
}
_flareLight.range = Constants.ZeroF;
_flareLight.flare = flares[rng.Next(flares.Length)];
_originalIntensity = _flareLight.intensity;
}
开发者ID:Maxii,项目名称:UnityEntry,代码行数:27,代码来源:StarFlare.cs
示例20: Start
protected void Start()
{
lightComponent = GetComponent<Light>();
lightIntensity = lightComponent.intensity;
lightComponent.enabled = (TOD_Sky.Instance.Components.Weather.Weather == type);
}
开发者ID:Drenerdo,项目名称:projectspark,代码行数:7,代码来源:LightAtWeather.cs
注:本文中的Light类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论