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 / 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.
@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;
#!/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 / 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;
/* 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 / 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");
}
//
@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
using System;
using System.Collections.Generic;
public class GameEvent
{
}
public class EventMessenger
{
@kimsama
kimsama / hemisphere.shader
Created February 7, 2014 03:25
Unity3D, Hemisphere Lighting
Shader "Custom/Hemisphere_Lighting"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_SkyColor("Sky Color",Color)=(1,1,1,1)
_GroundColor("Ground Color",Color)=(0,0,0,1)
}
SubShader
@kimsama
kimsama / gist:9847077
Created March 29, 2014 02:10
extending method to already exist class
public static class TransformHelper
{
public static Transform GetChild(this Transform self, string name)
{
Transform t = null;
if(name != "")
t = self.Find(name);
if(t == null)
t = self;
return t;