Skip to content

Instantly share code, notes, and snippets.

View Sacristan's full-sized avatar

Ģirts Ķesteris Sacristan

View GitHub Profile
@Sacristan
Sacristan / .gitattributes with LFS
Last active December 13, 2017 10:34
.gitattributes for Unity3D with git-lfs
# Unity
*.cginc text
*.cs diff=csharp text
*.shader text
# Unity YAML
*.anim merge=unityyamlmerge eol=lf
*.asset merge=unityyamlmerge eol=lf
*.controller merge=unityyamlmerge eol=lf
@Sacristan
Sacristan / .gitattributes
Created August 25, 2017 07:06 — forked from nemotoo/.gitattributes
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@Sacristan
Sacristan / GoogleMap.cs
Created August 7, 2017 10:56 — forked from derme302/GoogleMap.cs
Load a Google Map into Unity3D
/*
* Based on the Google Maps for Unity Asset
* https://www.assetstore.unity3d.com/en/#!/content/3573
* However the relience on UniWeb has been removed
*
*
Getting Started
---------------
1. Assign the GoogleMap component to your game object.
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.sln
*.suo
find . -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
@Sacristan
Sacristan / example.md
Last active April 2, 2017 11:04
Unity Coroutines
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    private enum States
    {
        Unknown,
@Sacristan
Sacristan / EditorCoroutine.cs
Last active April 13, 2017 03:20 — forked from benblo/EditorCoroutine.cs
EditorCoroutine: coroutines for Unity editor operations. Usage: EditorCoroutine.start(myIEnumerator)
//Original Author (gracefully borrowed): https://gist.github.com/benblo/10732554
//#define DEBUG_EDITORCOROUTINE
using System.Collections;
using UnityEditor;
namespace Sacristan.EditorExtensions
{
public class EditorCoroutine
{
This is roughly what DrawDefaultInspector() does:
override def OnInspectorGUI():
serializedObject.Update()
EditorGUIUtility.LookLikeInspector()
myIterator = serializedObject.FindProperty("myArrayField")
while true:
myRect = GUILayoutUtility.GetRect(0f, 16f);
showChildren = EditorGUI.PropertyField(myRect, myIterator)
break unless myIterator.NextVisible(showChildren)
@Sacristan
Sacristan / c_sharp_interactive_for_unity.md
Last active March 15, 2017 08:41
VS 2015 C# Interactive use UnityEngine Assembly

#How to open: View-> Other Windows -> C# Interactive

> #r "C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll"
> using UnityEngine;
> Mathf.Sign(-1)
-1
> Vector3 startPos = Vector3.zero;
> Vector3 endPos = Vector3.one;
using UnityEngine;
using System.Collections;

public class ScalePulse : MonoBehaviour
{
    [System.Serializable]
    private struct Scale
    {
 [SerializeField]