Skip to content

Instantly share code, notes, and snippets.

View Neferetheka's full-sized avatar

Galaad Linosfil Neferetheka

View GitHub Profile
@Neferetheka
Neferetheka / gist:4b79487e2c52870b93b07f7ad10d6d80
Last active August 15, 2017 15:14 — forked from Arakade/gist:9dd844c2f9c10e97e3d0
Call from OnDrawGizmos() to draw text at Unity3D glocal position in Editor
static void DrawString(string text, Vector3 worldPos, Color? colour = null) {
UnityEditor.Handles.BeginGUI();
var originalColor = GUI.color;
if (colour.HasValue)
{
GUI.color = colour.Value;
}
var view = UnityEditor.SceneView.currentDrawingSceneView;
Vector3 screenPos = view.camera.WorldToScreenPoint(worldPos);
Vector2 size = GUI.skin.label.CalcSize(new GUIContent(text));
@Neferetheka
Neferetheka / KIntent.kt
Created October 28, 2017 17:48 — forked from passsy/KIntent.kt
Kotlin extension functions to start a generic Activity
package com.pascalwelsch.extensions
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
/**
* Extensions for simpler launching of Activities