Skip to content

Instantly share code, notes, and snippets.

@leegoonz
Created June 29, 2019 17:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leegoonz/4470e306c9f583585e944b3f4969d45b to your computer and use it in GitHub Desktop.
Save leegoonz/4470e306c9f583585e944b3f4969d45b to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FixLightMapTiling : MonoBehaviour {
public GameObject _getLightmapScaleObj;
public GameObject _setLightmapScaleObj;
public Vector4 _lightmapScalOffset;
public int _lightmapIndex;
void OnDrawGizmos()
{
Renderer Lod0 = _getLightmapScaleObj.GetComponent<Renderer>();
Renderer LodChild = _setLightmapScaleObj.GetComponent<Renderer>();
_lightmapIndex = Lod0.lightmapIndex;
_lightmapScalOffset = Lod0.lightmapScaleOffset;
LodChild.lightmapIndex = _lightmapIndex;
//Debug.Log(LodChild.lightmapIndex);
LodChild.lightmapScaleOffset = _lightmapScalOffset;
//Debug.Log(LodChild.lightmapScaleOffset);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment