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; | |
using UnityEditor; | |
public static class CodeUtilUnity { | |
[MenuItem("Tools/Test: CreateCopyMethod (Transform)")] | |
public static void TestCreateCopyMethod () { | |
Debug.Log (CreateCopyMethod (typeof(Transform), true)); | |
} | |
} |
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; | |
using System.Collections; | |
using System.Collections.Generic; | |
/// <summary> | |
/// manages instances of the same material with random colors | |
/// if a Material+Color combination does not yet exist it will be created | |
/// if the combination has been created before it will be returned from the cached | |
/// </summary> | |
public static class ColoredMaterialCache { |
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
public static GameObject AddChildInAsset (GameObject prefab, string name = "NewChild") | |
{ | |
GameObject instance = (GameObject)PrefabUtility.InstantiatePrefab (prefab); | |
GameObject child = AddChild (instance, System.Guid.NewGuid ().ToString ()); | |
PrefabUtility.ReplacePrefab (instance, prefab, ReplacePrefabOptions.ConnectToPrefab); | |
GameObject newChild = prefab.transform.FindChild (child.name).gameObject; | |
GameObject.DestroyImmediate (instance); | |
newChild.name = name; | |
prefab.MakeDirty (); | |
AssetDatabase.SaveAssets (); |
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
public static void RemoveChildInAsset (GameObject child) | |
{ | |
GameObject prefab = PrefabUtility.FindPrefabRoot (child); | |
RemoveChildInAsset (prefab, child); | |
} | |
public static void RemoveChildInAsset (GameObject prefab, GameObject child) | |
{ | |
try { | |
string oldName = child.name; | |
child.name = System.Guid.NewGuid ().ToString (); |
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
-(void)presentPopupViewController:(UIViewController*)popupViewController; | |
-(void)dismissPopupViewController:(UIViewController*)popupViewController; |
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
MJPopupViewContentInteractionNone = 1, // no tap interaction, dismiss manually or from outside | |
MJPopupViewContentInteractionDismissEverywhere, // tapping the background or the viewcontroller will dismiss the popup | |
MJPopupViewContentInteractionDismissBackgroundOnly, // only tapping the background will dismiss the popup |
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
#!/bin/sh | |
DESC="Jenkins CI Server" | |
NAME=jenkins | |
PIDFILE=$HOME/$NAME.pid | |
LOGFILE=$HOME/Library/Logs/dopanic.$NAME.log | |
d_start() { | |
(nohup java -XX:PermSize=512M -XX:MaxPermSize=2048M -Xmn128M -Xms1024M -Xmx2048M -jar /usr/local/opt/jenkins/libexec/jenkins.war > $LOGFILE 2>&1) & | |
PID=$! |
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
Pod::Spec.new do |s| | |
s.name = 'TouchXML' | |
s.version = '0.1' | |
s.license = 'Simplified BSD License' | |
s.summary = "TouchXML is a lightweight replacement for Cocoa's NSXML* cluster of classes." | |
s.homepage = 'https://github.com/doPanic/TouchXML' | |
s.author = { 'Jonathan Wight' => 'schwa@toxicsoftware.com' } | |
s.source = { :git => 'https://github.com/doPanic/TouchXML.git', :commit => '5da25c16f20de52792bcb5cc3ea4c9dff4646e8f' } | |
s.source_files = 'Source/**/*.{h,m}' | |
s.requires_arc = true |