Skip to content

Instantly share code, notes, and snippets.

// Workaround for 1087657 https://issuetracker.unity3d.com/issues/android-cullallvisiblelights-consume-too-much-cpu-when-only-baked-lights-are-used-in-the-scene
Light[] lights = (Light[])GameObject.FindObjectsOfType(typeof(Light));
for (int i = 0; i < lights.Length; i++)
{
Light light = lights[i];
if (light.type == LightType.Point || light.type == LightType.Spot) // Assuming all your baked lights are these types
light.gameObject.SetActive(false);
}
@davehampson
davehampson / ShipCamera.cs
Last active January 31, 2023 23:21
Framerate independent blend
using UnityEngine;
public class ShipCamera : MonoBehaviour
{
public GameObject m_Ship;
public Vector3 m_RelativePos;
void LateUpdate()
{
//float scale = 0.05f; // Framerate dependent code, bad.
import csv, os, subprocess
def Main():
unityPid = GetUnityProcessID()
if unityPid:
print('Error: Unity is running (process ID {})'.format(unityPid))
return 1
# Make sure we have all heads that we need to merge locally: