Skip to content

Instantly share code, notes, and snippets.

View kimsama's full-sized avatar
๐Ÿ 
Working from home

Kim, Hyoun Woo kimsama

๐Ÿ 
Working from home
View GitHub Profile
@kimsama
kimsama / update_icon.py
Created November 22, 2013 07:11
Unity3D trampoline, yet 4.2.2 does not properly specify CFBundleIconFiles's setting which is needed to support iOS7's icon images. Run this python script to update that. Note that all icon files are should be under the same directory where .xcodeproj xcode project file is.
#!/usr/bin/python
#
# Run this script to add various icon files to info.plist
# which is needed to support iOS7 icon image files.
#
# (C)2013 Kim, Hyoun Woo
#
import sys
@kimsama
kimsama / gist:6446649
Created September 5, 2013 06:20
objective-c code to detect IAP cracker.
//
// Cydia is automaticly installed on every jailbroken device, so you can check for Jailbreak like this:
//
if ([[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/Cydia.app"]){
NSLog(@"Jailbreak detected");
}
//
/* Copyright (c) 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@kimsama
kimsama / ngui-2.6.4-dynamic-fonts-fix.patch
Last active December 21, 2015 13:49
A patch to fix NGUI 2.6.4. dynamic font problem which cause randomly disappearing of fonts.
diff -r 6e8e22fe6d82 Assets/NGUI/Scripts/Internal/UIWidget.cs
--- a/Assets/NGUI/Scripts/Internal/UIWidget.cs Thu Aug 08 12:15:03 2013 +0900
+++ b/Assets/NGUI/Scripts/Internal/UIWidget.cs Thu Aug 08 12:15:07 2013 +0900
@@ -7,6 +7,8 @@
#define OLD_UNITY
#endif
+#define DYNAMIC_FONT_BUG_FIX
+
using UnityEngine;
#!/usr/bin/env python
import sys, os.path
install_path = sys.argv[1]
target_platform = sys.argv[2]
if target_platform != "iPhone": sys.exit()
info_plist_path = os.path.join(install_path, 'Info.plist')
@kimsama
kimsama / test.cs
Last active December 18, 2015 04:39
์นด๋ฉ”๋ผ๊ฐ€ ํšŒ์ „ํ–ˆ๋Š”๋ฐ๋„ fingerPos ๊ฐ’์€ ์ด์ „ ๋ฒกํ„ฐ์˜ ๋ฐฉํ–ฅ ๊ทธ๋Œ€๋กœ์—ฌ์„œ ๋‚˜ํƒ€๋‚˜๋Š” ๋ฌธ์ œ ๊ฐ™์Šต๋‹ˆ๋‹ค. OnMyFingerDragMove ํ•จ์ˆ˜์—์„œ tempFingerPos ๋ฒกํ„ฐ๋ฅผ ์นด๋ฉ”๋ผ๊ฐ€ ํšŒ์ „ํ•œ ๋งŒํผ ํšŒ์ „ ์‹œํ‚จ ๋‹ค์Œ ๊ทธ ๊ฐ’์„ ์ ์šฉํ•ด ๋ณด๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.
using UnityEngine;
using System.Collections;
public class PickupAndMove : MonoBehaviour
{
public GameObject targetObject;
public GameObject noTargetObject; // ์„ ํƒํ•˜๋ฉด ์•ˆ๋˜๋Š” ์˜ค๋ธŒ์ ํŠธ(ํ…Œ์ด๋ธ”).
private int dragFingerIndex = -1;
@kimsama
kimsama / CleanCache.cs
Last active November 26, 2019 18:58
Unity editor script which deletes internal editor cache info related asset bundle. Put this script file under an Editor folder.
using UnityEngine;
using UnityEditor;
using System.Collections;
/// <summary>
/// An editor script which deletes cache info.
///
/// NOTE:
/// Delete all AssetBundle content that has been cached by the current application.
/// This function is not available to WebPlayer applications that use the shared cache.

Using Dropbox to Share Git Repositories

First, create a Git subfolder inside your Dropbox folder. Then you can share the individual projects inside that folder with whomever you want (or just use it for instant offsite backups).

From inside a Git project:

git clone --bare . ~/Dropbox/Git/gitproject.git
git remote add dropbox ~/Dropbox/Git/gitproject.git

When you're ready to push:

@kimsama
kimsama / CostumeAudioImporter.cs
Created May 1, 2013 05:34
A simple custom asset post processor script which disables '3D Sound' option of an imported sound asset.
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using System.Collections;
public class CostumeAudioImporter : AssetPostprocessor
{
void OnPreprocessAudio ()
{
AudioImporter audioImporter = assetImporter as AudioImporter;
@kimsama
kimsama / EnterLoadPage.cs
Created May 1, 2013 05:28
MonoBehaviour supports async loading progress status. (original post from http://unitystudy.net/bbs/board.php?bo_table=tip&wr_id=52)
using UnityEngine;
using System.Collections;
public class EnterLoadPage : MonoBehaviour
{
public UISlider script;
public UISlider scriptPercent;
public UILabel textscript;
AsyncOperation async;