本文整理汇总了C#中Light类的典型用法代码示例。如果您正苦于以下问题:C# Light类的具体用法?C# Light怎么用?C# Light使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Light类属于命名空间,在下文中一共展示了Light类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Chronic
public Chronic(string name, Water water, Light light, Food food)
: this(name)
{
Water = water;
Light = light;
Food = food;
}
示例2: Start
void Start()
{
pointLight = GetComponent<Light>();
startColor = pointLight.color;
anchorManager = ImportExportAnchorManager.Instance;
}
示例3: Start
void Start ()
{
mainLight = GetComponent<Light>();
skyMat = RenderSettings.skybox;
}
示例4: Start
void Start()
{
ThisBody = GetComponent<Rigidbody2D>();
Anim = GetComponent<Animator>();
TailLight = Light.GetComponent<Light>();
// SpriteRen = GetComponent<SpriteRenderer>();
}
示例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
}
}
}
示例6: Start
//AudioSource gunShot;
void Start()
{
shootableMask = LayerMask.GetMask ("Shootable");
gunLight = GetComponent <Light> ();
anim = GetComponent<Animator>();
}
示例7: Awake
/// <summary>
/// Find all needed components.
/// </summary>
void Awake ()
{
mWidget = GetComponentInChildren<UIWidget>();
Renderer ren = renderer;
if (ren != null) mMat = ren.material;
mLight = light;
}
示例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();
}
}
示例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;
}
示例10: Start
void Start()
{
myLight = GetComponentInChildren<Light>();
particles = GetComponentInChildren<ParticleSystem>();
particles.enableEmission = true;
myLight.intensity = 2;
}
示例11: Start
// Use this for initialization
void Start()
{
// set animation
this.animation = GetComponent<Animation> ();
// set fire ligth
this.fireLigth = this.effects.GetComponent<Light> ();
}
示例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;
}
}
示例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;
}
}
示例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));
}
示例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;
}