상속: Behaviour
예제 #1
0
        private void Start()
        {
            rndValue = UnityEngine.Random.value * 100.0f;
            lightObject = GetComponent<Light>();

            generate();
        }
예제 #2
0
		void Start()
		{
			startTime = Time.time;
			pEmitters = gameObject.GetComponentsInChildren<KSPParticleEmitter>();
			foreach(KSPParticleEmitter pe in pEmitters)
			{
				pe.emit = true;	
				pe.force = (4.49f * FlightGlobals.getGeeForceAtPosition(transform.position));
				if(pe.maxEnergy > maxTime)
				{
					maxTime = pe.maxEnergy;	
				}
			}
			lightFX = gameObject.AddComponent<Light>();
			lightFX.color = Misc.ParseColor255("255,238,184,255");
			lightFX.intensity = 8;
			lightFX.range = 50;
			
			exSound = GameDatabase.Instance.GetAudioClip("BDArmory/Sounds/explode1");
			audioSource = gameObject.AddComponent<AudioSource>();
			audioSource.minDistance = 20;
			audioSource.maxDistance = 1000;
			audioSource.volume = Mathf.Sqrt(GameSettings.SHIP_VOLUME);
			audioSource.PlayOneShot(exSound);
		}
예제 #3
0
		void Start () {
			spotLight = spotRotater.GetComponent<Light>();
			pixels = new Color[resolution * resolution];

			// Generate color map.
			Texture2D colorMapTexture = new Texture2D(32, 1, TextureFormat.ARGB32, false);
			colorMapTexture.wrapMode = TextureWrapMode.Clamp;
			colorMapDiagram.Fill(pixels, 32, 1);
			colorMapTexture.SetPixels(pixels);
			colorMapTexture.Apply();
			
			terrainTexture = new Texture2D(resolution, resolution, TextureFormat.ARGB32, false);
			terrainTexture.wrapMode = TextureWrapMode.Repeat;
			terrainTexture.name = "Dynamic Terrain";
			terrainMesh.Generate(resolution);
			
			// Fetch materials, set textures, and read initial settings.
			terrainMaterial = terrainMesh.materials[0];
			waterMaterial = terrainMesh.materials[1];
			
			waterMaterial.mainTexture = terrainMaterial.mainTexture = terrainTexture;
			terrainMaterial.SetTexture("_ColorMap", colorMapTexture);
			
			morphValue = heightFieldDiagram.GetInputValue("Morph");
			octavesValue = heightFieldDiagram.GetInputValue("Octaves");
			persistenceValue = heightFieldDiagram.GetInputValue("Persistence");
			secondary = heightFieldDiagram.GetInputValue("Secondary");
		}
예제 #4
0
        private MeshViewer()
            : base("Mesh Viewer", new Rect(512, 128, 512, 512), skin)
        {
            onDraw = DrawWindow;

            material = new Material(Shader.Find("Diffuse"));

            try
            {
                light = GameObject.Find("Directional Light").GetComponent<Light>();
            }
            catch (Exception)
            {
                light = null;
            }

            meshViewerCamera = gameObject.AddComponent<Camera>();
            meshViewerCamera.transform.position = new Vector3(-10000.0f, -10000.0f, -10000.0f);
            meshViewerCamera.fieldOfView = 20.0f;
            meshViewerCamera.backgroundColor = Color.grey;
            meshViewerCamera.nearClipPlane = 1.0f;
            meshViewerCamera.farClipPlane = 1000.0f;
            meshViewerCamera.enabled = false;

            targetRT = new RenderTexture(512, 512, 24, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Linear);
            meshViewerCamera.targetTexture = targetRT;
        }
        private void ConvertUnityLightToBabylon(Light light, float progress)
        {
            if (!light.isActiveAndEnabled || light.alreadyLightmapped)
            {
                return;
            }

            ExporterWindow.ReportProgress(progress, "Exporting light: " + light.name);

            BabylonLight babylonLight = new BabylonLight
            {
                name = light.name,
                id = GetID(light.gameObject),
                parentId = GetParentID(light.transform)
            };
            
            switch (light.type)
            {
                case LightType.Spot:
                    babylonLight.type = 2;
                    break;
                case LightType.Directional:
                    babylonLight.type = 1;
                    break;
                case LightType.Point:
                    babylonLight.type = 0;
                    babylonLight.range = light.range;
                    break;
                case LightType.Area:
                    // TODO
                    break;
            }

            babylonLight.position = light.transform.localPosition.ToFloat();

            var direction = new Vector3(0, 0, 1);
            var transformedDirection = light.transform.TransformDirection(direction);
            babylonLight.direction = transformedDirection.ToFloat();

            babylonLight.diffuse = light.color.ToFloat();

            babylonLight.intensity = light.intensity;

            babylonLight.angle = light.spotAngle * (float)Math.PI / 180;
            babylonLight.exponent = 1.0f;

            babylonScene.LightsList.Add(babylonLight);

            // Animations
            ExportAnimations(light.transform, babylonLight);

            // Shadows
            if (exportationOptions.ExportShadows)
            {
                if ((light.type == LightType.Directional || light.type == LightType.Spot) && light.shadows != LightShadows.None)
                {
                    GenerateShadowsGenerator(light);
                }
            }
        }
예제 #6
0
		void Start()
		{
			startTime = Time.time;
			pEmitters = gameObject.GetComponentsInChildren<KSPParticleEmitter>();
			foreach(KSPParticleEmitter pe in pEmitters)
			{
				pe.emit = true;	

				//if(pe.useWorldSpace) pe.force = (4.49f * FlightGlobals.getGeeForceAtPosition(transform.position));

				if(pe.maxEnergy > maxTime)
				{
					maxTime = pe.maxEnergy;	
				}
			}
			lightFX = gameObject.AddComponent<Light>();
			lightFX.color = Misc.ParseColor255("255,238,184,255");
			lightFX.intensity = 8;
			lightFX.range = range*3f;
			lightFX.shadows = LightShadows.None;
			
			
			
			audioSource.volume = BDArmorySettings.BDARMORY_WEAPONS_VOLUME;
			
			audioSource.PlayOneShot(exSound);
		}
예제 #7
0
    private void OnEnable()
    {
      lightModes = new string[2];
      lightModes[0] = @"UnLit";
      lightModes[1] = @"BumpLit";

      spriteRenderer = this.GetComponent<SpriteRenderer>();

      sunLight = this.GetComponent<Light>();

      hsbColor = new HSBColor(Color.white);
      hsbColor.s = 1.0f;

      if (GameObject.Find("FlareSpawner0") != null)
      {
        flareSpawners.Add(GameObject.Find("FlareSpawner0").GetComponent<Spawner>());
        flareSpawners[0].enabled = false;
      }

      if (GameObject.Find("FlareSpawner1") != null)
      {
        flareSpawners.Add(GameObject.Find("FlareSpawner1").GetComponent<Spawner>());
        flareSpawners[1].enabled = false;
      }

      if (GameObject.Find("FlareSpawner2") != null)
      {
        flareSpawners.Add(GameObject.Find("FlareSpawner2").GetComponent<Spawner>());
        flareSpawners[2].enabled = false;
      }
    }
예제 #8
0
 void ApplyAOLight(ref Color c, Light l, Vector3 pos, Vector3 n)
 {
    if (!l.isActiveAndEnabled)
       return;
    Vector3 dir;
    float intensity = l.intensity;
    if (l.type == LightType.Directional)
    {
       dir = -l.transform.forward;
    }
    else if (l.type == LightType.Point)
    {
       dir = (l.transform.position - pos).normalized;
       intensity *= Mathf.Clamp01((l.range - Vector3.Distance(l.transform.position, pos)) / l.range);
    }
    else
    {
       return;
    }
    
    intensity *= Mathf.Clamp01(Vector3.Dot(n, dir));
   
    c.r += l.color.r * intensity;
    c.g += l.color.g * intensity;
    c.b += l.color.b * intensity;
 }
예제 #9
0
 void SetColor(Transform _transform, Color _color)
 {
     mText = _transform.GetComponent<Text> ();
     if (mText != null){
         mText.color = _color;
     }
     mLight = _transform.GetComponent<Light>();
     if (mLight != null){
         mLight.color = _color;
     }
     mImage = _transform.GetComponent<Image> ();
     if (mImage != null) {
         mImage.color = _color;
     }
     mSpriteRender = _transform.GetComponent<SpriteRenderer> ();
     if (mSpriteRender != null) {
         mSpriteRender.color = _color;
     }
     if (_transform.GetComponent<Renderer>() != null) {
         mMat = _transform.GetComponent<Renderer>().material;
         if (mMat != null) {
             mMat.color = _color;
         }
     }
     if (includeChilds) {
         for (int i = 0; i < _transform.childCount; ++i) {
             Transform child = _transform.GetChild(i);
             SetColor(child, _color);
         }
     }
 }
예제 #10
0
        private void GenerateShadowsGenerator(Light light)
        {
            var generator = new BabylonShadowGenerator
            {
                lightId = GetID(light.gameObject),
                usePoissonSampling = light.shadows == LightShadows.Soft,
                mapSize = 256 + 256 * QualitySettings.GetQualityLevel(),
                bias = light.shadowBias / 10.0f
            };

            var renderList = new List<string>();
            foreach (var gameObject in gameObjects)
            {
                var meshFilter = gameObject.GetComponent<MeshFilter>();
                var renderer = gameObject.GetComponent<Renderer>();
                if (meshFilter != null && renderer != null && renderer.shadowCastingMode != ShadowCastingMode.Off)
                {
                    renderList.Add(GetID(gameObject));
                    continue;
                }

                var skinnedMesh = gameObject.GetComponent<SkinnedMeshRenderer>();
                if (skinnedMesh != null && renderer != null && renderer.shadowCastingMode != ShadowCastingMode.Off)
                {
                    renderList.Add(GetID(gameObject));
                }
            }

            generator.renderList = renderList.ToArray();

            babylonScene.ShadowGeneratorsList.Add(generator);
        }
예제 #11
0
 public UnityLight(GameObject obj)
 {
     light = obj.GetComponent<Light>();
     if (null == light) {
         light = obj.AddComponent<Light>();
     }
 }
    // Use this for initialization
    void Start()
    {
        m_currentRange = MaxRange;
        m_stepSize = FlickerSpeed;
        m_currentLightCharge = LightCharge;

        if (LightPrefab)
        {
            SkinnedMeshRenderer mesh = GameObject.Find("Body_Lowpoly").GetComponent<SkinnedMeshRenderer>();
            Transform parentTransform = mesh.bones[9].transform;
            parentTransform = parentTransform.transform.FindChild("Bip001 Spine2");
            parentTransform = parentTransform.transform.FindChild("Bip001 Spine3");
            parentTransform = parentTransform.transform.FindChild("Bone017");
            parentTransform = parentTransform.transform.FindChild("Bone018");
            parentTransform = parentTransform.transform.FindChild("connectBone001");
            parentTransform = parentTransform.transform.FindChild("Bone030");
            parentTransform = parentTransform.transform.FindChild("LightAttatchBone");

            GameObject obj = (GameObject)Instantiate(LightPrefab, Vector3.zero, Quaternion.identity);
            m_light = obj.GetComponent<Light>().light;
            m_light.transform.parent = parentTransform;
            m_light.transform.localPosition = Vector3.zero;
            m_light.color = LightColor;
            m_light.range = MaxRange;
            m_light.intensity = MaxIntensity;
        }
    }
예제 #13
0
 public void Awake()
 {
     this.light = GetComponentInChildren<Light>();
     if (light == null) {
         throw new MissingComponentException("Light Component required for AmbientFire");
     }
 }
예제 #14
0
 public static void ExtinguishLight(Light light, float extinguishAfter, float timeToExtinguish)
 {
     DOTween.Sequence()
         .AppendInterval(extinguishAfter)
         .Append(light.DOIntensity(8, .00001f))
         .Append(light.DOIntensity(0, timeToExtinguish)
         .SetEase(Ease.InBack));
 }
예제 #15
0
 public void Start()
 {
     _line = GetComponent<LineRenderer>();
     _line.enabled = false;
     _light = GetComponent<Light>();
     _light.enabled = false;
     _renderer = _line.GetComponent<Renderer>();
 }
		IEnumerator Flash(Light light) {
			for(int x = 0; x < 3; x++) {
				light.intensity = intensity;
				yield return new WaitForSeconds(0.05f);
				light.intensity = 0f;
				yield return new WaitForSeconds(0.05f);
			}
		}
예제 #17
0
        public SSDDomeLight(Light light)
            : base(light)
        {
            LightAdapter adapter = light.GetComponent<LightAdapter>();

            if (adapter)
                this.texture = adapter.texture;
        }
예제 #18
0
 public override void OnStart()
 {
     var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
     if (currentGameObject != prevGameObject) {
         light = currentGameObject.GetComponent<Light>();
         prevGameObject = currentGameObject;
     }
 }
예제 #19
0
 private void Start()
 {
     m_Rnd = Random.value;
     if(m_Rnd < 0.5f)
         m_Rnd = 0.5f;
     m_Rnd *= 25;
     m_Light = GetComponent<Light>();
 }
예제 #20
0
        public SSDSphereLight(Light light)
            : base(light)
        {
            LightAdapter adapter = light.GetComponent<LightAdapter>();

            if (adapter)
                this.radius = adapter.radius;
        }
예제 #21
0
파일: UnityLight.cs 프로젝트: gturk/Uniject
 public UnityLight(IGameObject obj)
     : base(obj)
 {
     light = obj.GetComponent<Light>();
     if (null == light) {
         throw new NullReferenceException("Object " + obj.Name  + " expected to have Light but none was found");
     }
 }
예제 #22
0
        void Start()
        {
            this.player = SingletonNames.getPlayer().transform;
            this.currentLight  = gameObject.GetComponent<Light>();

            defaultIntensity = currentLight.intensity;
            deltaRange       = disableRange - maxRange;
        }
 void Awake()
 {
     shootableMask = LayerMask.GetMask ("Shootable");
     gunParticles = GetComponent<ParticleSystem> ();
     gunLine = GetComponent <LineRenderer> ();
     gunAudio = GetComponent<AudioSource> ();
     gunLight = GetComponent<Light> ();
     timeBetweenBullets = 1f / shotsPerSecond;
 }
        float effectsDisplayTime = 0.2f;                // The proportion of the timeBetweenBullets that the effects will display for.


        void Awake ()
        {
            // Set up the references.
            gunParticles = GetComponent<ParticleSystem> ();
            gunLine = GetComponent <LineRenderer> ();
            gunAudio = GetComponent<AudioSource> ();
            gunLight = GetComponent<Light> ();
			//faceLight = GetComponentInChildren<Light> ();
        }
        float effectsDisplayTime = 0.2f;                // The proportion of the timeBetweenBullets that the effects will display for.


        void Awake ()
        {
            // Create a layer mask for the Shootable layer.
			shootableMask = LayerMask.GetMask ("Obstacles") | LayerMask.GetMask ("Unit");

            // Set up the references.
            gunLine = GetComponent <LineRenderer> ();
            gunAudio = GetComponent<AudioSource> ();
            gunLight = GetComponent<Light> ();
        }
예제 #26
0
 // Use this for initialization
 void Start()
 {
     light = GetComponent<Light>();
     if (light == null)
     {
         Debug.Log("Flicker: no light attached to this script!");
         gameObject.active = false;
     }
     originalIntensity = light.intensity;
 }
예제 #27
0
	void Cache ()
	{
		mCached = true;
        mMaskableGraphic = GetComponent<MaskableGraphic>();
        Renderer ren = gameObject.GetComponent<Renderer>();
		if (ren != null) mMat = ren.material;
		mLight = gameObject.GetComponent<Light>();
        if (mMaskableGraphic == null && mMat == null && mLight == null)
            mMaskableGraphic = GetComponentInChildren<MaskableGraphic>();
	}
예제 #28
0
        void Awake()
        {
            // Create a layer mask for the Shootable layer.
            shootableMask = LayerMask.GetMask("Shootable");

            // Set up the references.
            gunParticles = GetComponent<ParticleSystem>();
            gunLine = GetComponent<LineRenderer>();
            gunLight = GetComponent<Light>();
        }
        void Start()
        {
            // Get components
            myLight = GetComponent<Light>();
            player = GameManager.Instance.PlayerObject;

            // Disable dungeon light shadows
            if (!DaggerfallUnity.Settings.DungeonLightShadows)
                myLight.shadows = LightShadows.None;
        }
예제 #30
0
 public override void Awake() {
     _audio = GetComponent<AudioSource>();
     _light = GetComponent<Light>();
     _light.intensity = 0f;
     _renderer = GetComponent<Renderer>();
     _collider = GetComponent<Collider>();
     _collider.isTrigger = true;
     sounds = new RandList<AudioClip>();
     sounds.AddRange(crystalSounds);
 }
예제 #31
0
    static int set_color(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj  = (UnityEngine.Light)o;
            UnityEngine.Color arg0 = ToLua.ToColor(L, 2);
            obj.color = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index color on a nil value"));
        }
    }
    static int get_commandBufferCount(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            int ret = obj.commandBufferCount;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index commandBufferCount on a nil value"));
        }
    }
    static int get_renderingLayerMask(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            int ret = obj.renderingLayerMask;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index renderingLayerMask on a nil value"));
        }
    }
    static int get_shadowCustomResolution(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            int ret = obj.shadowCustomResolution;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index shadowCustomResolution on a nil value"));
        }
    }
예제 #35
0
    static int set_layerShadowCullDistances(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj  = (UnityEngine.Light)o;
            float[]           arg0 = ToLua.CheckNumberArray <float>(L, 2);
            obj.layerShadowCullDistances = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index layerShadowCullDistances on a nil value"));
        }
    }
예제 #36
0
 static int DOColor(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UnityEngine.Light   obj  = (UnityEngine.Light)ToLua.CheckObject(L, 1, typeof(UnityEngine.Light));
         UnityEngine.Color   arg0 = ToLua.ToColor(L, 2);
         float               arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
         DG.Tweening.Tweener o    = obj.DOColor(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int set_cullingMask(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.cullingMask = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index cullingMask on a nil value"));
        }
    }
    static int get_shadowMatrixOverride(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light     obj = (UnityEngine.Light)o;
            UnityEngine.Matrix4x4 ret = obj.shadowMatrixOverride;
            ToLua.PushValue(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index shadowMatrixOverride on a nil value"));
        }
    }
    static int set_lightShadowCasterMode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            UnityEngine.LightShadowCasterMode arg0 = (UnityEngine.LightShadowCasterMode)ToLua.CheckObject(L, 2, typeof(UnityEngine.LightShadowCasterMode));
            obj.lightShadowCasterMode = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index lightShadowCasterMode on a nil value"));
        }
    }
예제 #40
0
    static int set_cookieSize(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj  = (UnityEngine.Light)o;
            float             arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.cookieSize = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index cookieSize on a nil value" : e.Message));
        }
    }
    static int get_bakingOutput(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light             obj = (UnityEngine.Light)o;
            UnityEngine.LightBakingOutput ret = obj.bakingOutput;
            ToLua.PushValue(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index bakingOutput on a nil value"));
        }
    }
    static int get_flare(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            UnityEngine.Flare ret = obj.flare;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index flare on a nil value"));
        }
    }
    static int get_shadowResolution(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            UnityEngine.Rendering.LightShadowResolution ret = obj.shadowResolution;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index shadowResolution on a nil value"));
        }
    }
예제 #44
0
    static int set_cookie(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light   obj  = (UnityEngine.Light)o;
            UnityEngine.Texture arg0 = (UnityEngine.Texture)ToLua.CheckObject <UnityEngine.Texture>(L, 2);
            obj.cookie = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index cookie on a nil value"));
        }
    }
예제 #45
0
    static int get_cookieSize(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            float             ret = obj.cookieSize;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index cookieSize on a nil value" : e.Message));
        }
    }
예제 #46
0
    static int set_alreadyLightmapped(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            bool arg0             = LuaDLL.luaL_checkboolean(L, 2);
            obj.alreadyLightmapped = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index alreadyLightmapped on a nil value" : e.Message));
        }
    }
예제 #47
0
    static int get_lightShadowCasterMode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            UnityEngine.LightShadowCasterMode ret = obj.lightShadowCasterMode;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index lightShadowCasterMode on a nil value"));
        }
    }
    static int set_useColorTemperature(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            bool arg0             = LuaDLL.luaL_checkboolean(L, 2);
            obj.useColorTemperature = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index useColorTemperature on a nil value"));
        }
    }
예제 #49
0
    static int get_alreadyLightmapped(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            bool ret = obj.alreadyLightmapped;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index alreadyLightmapped on a nil value" : e.Message));
        }
    }
    static int get_color(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            UnityEngine.Color ret = obj.color;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index color on a nil value"));
        }
    }
예제 #51
0
    static int set_shadowResolution(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            UnityEngine.Rendering.LightShadowResolution arg0 = (UnityEngine.Rendering.LightShadowResolution)ToLua.CheckObject(L, 2, typeof(UnityEngine.Rendering.LightShadowResolution));
            obj.shadowResolution = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index shadowResolution on a nil value"));
        }
    }
예제 #52
0
    static int get_renderMode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light           obj = (UnityEngine.Light)o;
            UnityEngine.LightRenderMode ret = obj.renderMode;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index renderMode on a nil value" : e.Message));
        }
    }
예제 #53
0
    static int RemoveAllCommandBuffers(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.Light.RemoveAllCommandBuffers");
#endif
        try
        {
            ToLua.CheckArgsCount(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)ToLua.CheckObject(L, 1, typeof(UnityEngine.Light));
            obj.RemoveAllCommandBuffers();
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    static int set_range(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj  = (UnityEngine.Light)o;
            float             arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.range = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index range on a nil value"));
        }
    }
예제 #55
0
    static int set_shadows(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light        obj  = (UnityEngine.Light)o;
            UnityEngine.LightShadows arg0 = (UnityEngine.LightShadows)ToLua.CheckObject(L, 2, typeof(UnityEngine.LightShadows));
            obj.shadows = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index shadows on a nil value" : e.Message));
        }
    }
    static int get_layerShadowCullDistances(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            float[]           ret = obj.layerShadowCullDistances;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index layerShadowCullDistances on a nil value"));
        }
    }
    static int get_useShadowMatrixOverride(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            bool ret = obj.useShadowMatrixOverride;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index useShadowMatrixOverride on a nil value"));
        }
    }
예제 #58
0
    static int get_cullingMask(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            int ret = obj.cullingMask;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index cullingMask on a nil value" : e.Message));
        }
    }
    static int get_range(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)o;
            float             ret = obj.range;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index range on a nil value"));
        }
    }
예제 #60
0
    static int set_renderMode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Light           obj  = (UnityEngine.Light)o;
            UnityEngine.LightRenderMode arg0 = (UnityEngine.LightRenderMode)ToLua.CheckObject(L, 2, typeof(UnityEngine.LightRenderMode));
            obj.renderMode = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index renderMode on a nil value" : e.Message));
        }
    }