This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////// | |
// Find PhysX components that will trigger the Unity 2018 complaint about | |
// kinematic with Continuous Collision Detection: | |
// | |
// ERROR: [Physics.PhysX] RigidBody::setRigidBodyFlag: kinematic bodies with CCD enabled are not supported! CCD will be ignored. | |
// | |
// Use the script to find troublesome components in the scene or in the project | |
// then manually change them to a valid value, likely ContinuousSpeculative | |
// | |
// See https://docs.unity3d.com/ScriptReference/CollisionDetectionMode.ContinuousSpeculative.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File "MyInternalClass.cs" | |
* in "MyName" assembly (defined by a "MyName.asmdef"): | |
*/ | |
using System.Runtime.CompilerServices; | |
// Make this class available to its Unity PropertyDrawer despite being 'internal' | |
[assembly: InternalsVisibleTo("MyName_Editor")] | |
namespace my.name { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
namespace UGS.environ { | |
/// <summary> | |
/// Rotates the skybox of the scene or camera. | |
/// Requires a special shader. | |
/// </summary> | |
internal sealed class SkyBoxRotation : MonoBehaviour { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import bmesh | |
import mathutils | |
from math import radians, degrees | |
from mathutils.bvhtree import BVHTree | |
def rayCastConditional(ray, rayTarget, increment, predicate): | |
"""Cast multiple rays until 'predicate' passes. | |
ray: (p, direction) | |
rayTarget: something with ray_cast() such as: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
namespace UGS { | |
/// <summary> | |
/// See <seealso cref="http://docs.unity3d.com/ScriptReference/Application.CaptureScreenshot.html"/>. | |
/// N.b. docs now say "Removed in version 2017.3.0p1" | |
/// Now API call includes super-size facility https://docs.unity3d.com/ScriptReference/ScreenCapture.CaptureScreenshot.html | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
namespace UGS.unityutil.attributes { | |
/// <summary> | |
/// Checks non-null (and non-empty if applied to a string, non-zero if a scalar or Vector, etc) in a custom inspector. | |
/// Colours red if any problems. | |
/// </summary> | |
public sealed class NonNullAttribute : PropertyAttribute { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, os, dropbox, time | |
from datetime import datetime | |
APP_KEY = 'API_KEY' # INSERT APP_KEY HERE | |
APP_SECRET = 'APP_SECRET' # INSERT APP_SECRET HERE | |
DELAY = 0.2 # delay between each file (try to stay under API rate limits) | |
HELP_MESSAGE = \ | |
"""Note: You must specify the path starting with "/", where "/" is the root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ GitPortPatch.sh 22b7f80c22ac1861e945ddf30e30671c46b53d6e | |
Getting commit message | |
Getting patch | |
Getting affected filenames | |
Getting current status of those files... | |
Checking them... | |
Ensuring affected files are ready for patching... | |
Preparing Assets/TerraVolPack/TerraVol/Scripts/Data/MeshData.cs | |
Preparing Assets/TerraVolPack/TerraVol/Scripts/Map/Chunk.cs | |
Apply patch? y/n : y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
namespace UGS { | |
class SizeTesting : MonoBehaviour { | |
private const string msgFmt = "{0}:\t\t{1:0.000} bytes"; | |
public void Awake() { | |
v<byte>(); | |
v<int>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void save(string filePath) { | |
// ... | |
using (TextWriter writer = File.CreateText(filePath)) {var serializer = getSerializer(errors); | |
var errors = new List<string>(); | |
var serializer = getSerializer(errors); | |
serializer.Serialize(writer, snapshot); | |
logErrors(errors); | |
} | |
// ... |