블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2737)
Unity3D (817)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-27 00:02
반응형
Posted by blueasa
, |
반응형
Posted by blueasa
, |

http://ip2c.org/ 에 25$ 기부하고 사용하기로 결정.


c#에서는 아래와 같은 함수를 만들어서 간단히 이용 가능함.


public IEnumerator getGeoIP(){


if (DataManager.Inst.psd.systemOpt.nation.Length == 0) {

WWW www = new WWW ("http://ip2c.org/self");

while (!www.isDone) {

yield return new WaitForSeconds (0.1f);

}


if (www.text.Length > 1) {

string[] listnation = www.text.Split (';');

Debug.Log( listnation [2] );

}

}

}


각 국가의 국기 이미지 처리 방법 


http://www.gamedevforever.com/301



출처: http://ongamedev.tistory.com/entry/지역-코드-얻어오기 [가끔 보자, 하늘.]

반응형
Posted by blueasa
, |
반응형
Posted by blueasa
, |

I love Git. I was very much a TFS purist up until the last year or so, but after using Git for a while now, I’m hooked. Whilst TFS certainly isn’t bad, I love the flexibility and the fact I can muck about to my hearts content in a DVCS without affecting anyone (unless I choose to). That doesn’t mean I love everything though, one of my biggest headaches recently has been tags.

Tags in Git are simply textual markers against specific commits, very much like branches (although tags don’t move). Generally they’re used to mark points in your commit history (i.e. versions etc), but they can – being just text – be used to mark anything really.

So what’s the problem? Well, the issue isn’t with tags themselves, it’s more with the fact they’re very, very annoying to kill. I purposefully say kill and not delete, because deleting a tag is actually very simple, it’s making sure that tag staysdeleted/dead that’s the problem. Once a tag has been pushed to a remote, it is automatically retrieved during any subsequent pulls, at this point the tag exists in the user’s local repository until they choose to delete it. But it also means that said user can also then re-push a single tag – or even worse, all their local tags – to a remote when doing a push.

To illustrate this, consider the following example:

  1. Bob creates the tag ‘foo’ against a commit and pushes this to a remote
  2. Fred pulls from the remote to update his local copy of a branch he’s working on with Jane
  3. Jane does the same as Fred, meaning both Fred and Jane now have Bob’s tag ‘foo’ in their local repos
  4. Bob realises that ‘foo’ is a terrible name for a tag and wants to delete it, so he deletes the tag locally and pushes the delete to the remote
  5. Fred has written some more code he wants to share with Jane, so – using his handy Atlassian SourceTree app – he pushes his changes. But; Fred doesn’t 100% understand what he’s doing, so he checks the “Push all tags” checkbox when doing his push, thus re-pushing the tag which Bob just deleted!
  6. Bob does a further pull later that day, and lo and behold, his poorly named tag ‘foo’ has reappeared in his local repository!
  7. Jane pulls again and also pulls down the once deleted tag, much to Bob’s annoyance

Alright, so the answer here is probably to give Fred some guidance about how to use Git, but it does illustrate the real life problem I had recently, the only difference was that in my situation there were lots more developers involved.

So how do you solve this? Well, the Git documentation states that – by default – tags are not pushed unless you specify otherwise (using the “tags” switch). So actually, Git does a pretty good job of preventing people from automatically sharing all their tags, but tools like SourceTree, which provide a seductive “Push all tags” checkbox when pushing – are clearly too tempting for developers to pass up:

SourceTreePushDialog   

Another option – and probably a better one than just relying on your developers to not push their tags – is to implement a pre-receive server side hook to check whether tags are being pushed and reject the push it the user doesn’t have permission. Unfortunately, if you’re using a hosted Git repository like GitHub or Bitbucket, you’re out of luck as they don’t currently provide the ability for you to edit hooks and unfortunately don’t allow you to apply permissions to tags. This is a real shame as the functionality is already there to control access to branches.

Of course, the final option is just to accept that tags are not really meant to be deleted after they’re pushed, which is all well and good if you and your developers understand this from the start, not so good if not!


[출처] http://thecurlybracket.com/2014/10/11/git-zombie-tags-from-hell/

반응형
Posted by blueasa
, |


IntPtr.Size returns 8 when the app is 64 bit and 4 when the app is 32 bit. – Programmer Oct 9 '16 at 5:12


[출처] https://stackoverflow.com/questions/39939785/how-to-know-unity-build-application-is-32bit-or-64bit

반응형
Posted by blueasa
, |
한 때 재밌게 하던 좋아하던 리듬게임 이었는데..

왜 접었는지 모르겠다.. =_=;;



[출처] http://bbs.ruliweb.com/hobby/board/300538/read/319237?


반응형

'Memories' 카테고리의 다른 글

[스케치] 고딩 때 그린 그림  (0) 2020.01.05
[인증] 게임코디 장패드!  (2) 2018.05.24
[Try & Error] 2017 티스토리 결산  (0) 2018.01.07
우리집 무화과 & 부모님  (1) 2015.10.05
[MUD] [2015-09-13] 마계지문 재오픈  (6) 2015.09.14
Posted by blueasa
, |

유니티에서 스트리밍 방식으로 미리듣기를 재생하기 위해 처리.


[Engine] Unity v5.6.5f1


IEnumerator LoadPreListening_Streaming_Server()
{
    AudioSource asPreListening = new AudioSource();
    WWW www = new WWW("URL");
    while (www.progress < 0.01)
    {
        Debug.Log(www.progress);
        yield return null;
    }
    
    if (!string.IsNullOrEmpty(www.error))
    {
        Debug.Log(www.error);
        yield break;
    }
    else
    {
        yield return null;
        //asPreListening.clip = WWWAudioExtensions.GetAudioClip(www, false, true, AudioType.MPEG); // MP3
        asPreListening.clip = WWWAudioExtensions.GetAudioClip(www, false, true, AudioType.OGGVORBIS); // OGG

        while (asPreListening.clip.loadState == AudioDataLoadState.Failed
                || asPreListening.clip.loadState == AudioDataLoadState.Unloaded
                || asPreListening.clip.loadState == AudioDataLoadState.Loading)
        {
            yield return null;
        }

        if (asPreListening.clip.loadState == AudioDataLoadState.Loaded)
        {
            // Play PreListening
            asPreListening.time = 0f;
            asPreListening.volume = 0f;
            asPreListening.loop = true;
            asPreListening.Play();
        }
    }
}



[참조]

https://answers.unity.com/questions/1395471/how-do-i-properly-stream-music-with-wwwaudioextens.html?childToView=1398578#answer-1398578

반응형
Posted by blueasa
, |
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Tools : MonoBehaviour {

    //get local ip address
    public string getIP() {

        string IP = "";

        IP = Network.player.ipAddress; <--- this

        return IP;
    }

    //get all ip addresses in local network
    public List<string> getIPArray() {

        List<string> listIP = new List<string>();


        return listIP;
    }
}



[출처]

https://stackoverflow.com/questions/37951902/how-to-get-ip-addresses-of-all-devices-in-local-network-with-unity-unet-in-c


[참조] http://www.devkorea.co.kr/bbs/board.php?bo_table=m03_qna&wr_id=29214

반응형
Posted by blueasa
, |

Unity에서 Xcode 출력 후 필요한 설정을 자동화하는 방법입니다. 
이번에는 잘 사용할 것 같은 것을 샘플 형식으로 정리했습니다.

■ 이용하는 기능 
Unity5에서 표준 이용할 수있게되었다 XcodeAPI을 이용 
Unity - Scripting API : PBXProject

■ 자동화 항목 
빌드 설정 편집 
프레임 워크의 추가 
컴파일 플래그의 설정 
· Info.plist 추가

■ 전 준비 
PostProcessBuildAttribute를 이용하여 빌드 후 메소드를 호출

using System.IO;
 using UnityEngine;
 using UnityEditor;
 using UnityEditor.iOS.Xcode;
 using UnityEditor.Callbacks;
 using System.Collections;

public  class XcodeSettingsPostProcesser
{
    [PostProcessBuildAttribute ( 0 )]
     public  static  void OnPostprocessBuild (BuildTarget buildTarget, string pathToBuiltProject)
    {
        // iOS 이외 플랫폼은 처리를하지 
        if (buildTarget! = BuildTarget.iOS) return ;

        // PBXProject 초기화 
        var projectPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj" ;
        PBXProject pbxProject = new PBXProject ();
        pbxProject.ReadFromFile (projectPath);
        string targetGuid = pbxProject.TargetGuidByName ( "Unity-iPhone" );
        
        // 여기에 자동화 처리 기술

        // 설정을 반영
        File.WriteAllText (projectPath, pbxProject.WriteToString ());
    }
}

■ 빌드 설정 편집

// 빌드 설정 추가 
pbxProject.AddBuildProperty (targetGuid, "OTHER_LDFLAGS" , "-all_load" );

// 빌드 설정 추가 
pbxProject.SetBuildProperty (targetGuid, "ENABLE_BITCODE" , "NO" );

// 빌드 설정 편집, 제 3 인수는 추가 설정 제 4 인수는 삭제 설정 
pbxProject.UpdateBuildProperty (targetGuid, "OTHER_LDFLAGS" , new  string [] { "-ObjC" }, new  string [] { "- weak_framework " });

■ 프레임 워크 추가

// 필수 프레임 워크의 추가 
pbxProject.AddFrameworkToProject (targetGuid, "Security.framework" , false );

// 옵션 프레임 워크의 추가 
pbxProject.AddFrameworkToProject (targetGuid, "SafariServices.framework" , true );

■ 컴파일 플래그 설정

// Keyboard.mm에 -fno-objc-arc를 설정 
var guid = pbxProject.FindFileGuidByProjectPath ( "Classes / UI / Keyboard.mm" );
var flags = pbxProject.GetCompileFlagsForFile (targetGuid, guid);
flags.Add ( "-fno-objc-arc" );
pbxProject.SetCompileFlagsForFile (targetGuid, guid, flags);

■ Info.plist 추가

// Plist 설정을위한 초기화 

var plistPath = Path.Combine (pathToBuiltProject, "Info.plist" );

var plist = new PlistDocument ();

plist.ReadFromFile (plistPath);



// 문자열의 설정 

plist.root.SetString ( "hogehogeId" , "dummyid" );



// URL 스키마 추가 var array = plist.root.CreateArray ( "CFBundleURLTypes");

var urlDict = array.AddDict ();

urlDict.SetString ( "CFBundleURLName" , "hogehogeName" );

var urlInnerArray = urlDict.CreateArray ( "CFBundleURLSchemes" );

urlInnerArray.AddString ( "hogehogeValue" );



// 설정을 반영

plist.WriteToFile (plistPath);

■ 정리 
Unity5되어 설정이 상당히 쉬워졌습니다

■ 코드 전체

using System.IO ;
using UnityEngine ;
using UnityEditor ;
using UnityEditor.iOS.Xcode ;
using UnityEditor.Callbacks ;
using System.Collections ;
public class XcodeSettingsPostProcesser
{
[PostProcessBuildAttribute ( 0 )
public static void OnPostprocessBuild ( BuildTarget buildTarget , string pathToBuiltProject )
{
// Stop processing if targe is NOT iOS
if (buildTarget! = BuildTarget.iOS)
return ;
// Initialize PbxProject
var projectPath = pathToBuiltProject + " /Unity-iPhone.xcodeproj/project.pbxproj " ;
PBXProject pbxProject = new PBXProject ();
pbxProject.ReadFromFile (projectPath);
string targetGuid = pbxProject.TargetGuidByName ( " Unity-iPhone " );
// Sample of adding build property
pbxProject.AddBuildProperty (targetGuid, " OTHER_LDFLAGS " , " -all_load " );
// Sample of setting build property
pbxProject.SetBuildProperty (targetGuid, " ENABLE_BITCODE " , " NO " );
// Sample of update build property
pbxProject.UpdateBuildProperty (targetGuid, " OTHER_LDFLAGS " , new string [] { " -ObjC " }, new string [] { " -weak_framework " });
// Sample of adding REQUIRED framwrok
pbxProject.AddFrameworkToProject (targetGuid, " Security.framework " , false );
// Sample of adding OPTIONAL framework
pbxProject.AddFrameworkToProject (targetGuid, " SafariServices.framework " , true );
// Sample of setting compile flags
var guid = pbxProject.FindFileGuidByProjectPath ( " Classes / UI / Keyboard.mm " );
var flags = pbxProject.GetCompileFlagsForFile (targetGuid, guid);
flags.Add ( " -fno-objc-arc " );
pbxProject.SetCompileFlagsForFile (targetGuid, guid, flags);
// Apply settings
File.WriteAllText (projectPath, pbxProject.WriteToString ());
// Samlpe of editing Info.plist
var plistPath = Path.Combine (pathToBuiltProject, " Info.plist " );
var plist = new PlistDocument ();
plist.ReadFromFile (plistPath);
// Add string setting
plist.root.SetString ( " hogehogeId " , " dummyid " );
// Add URL Scheme
var array = plist.root.CreateArray ( " CFBundleURLTypes " );
var urlDict = array.AddDict ();
urlDict.SetString ( " CFBundleURLName " , " hogehogeName " );
var urlInnerArray = urlDict.CreateArray ( " CFBundleURLSchemes " );
urlInnerArray.AddString ( " hogehogeValue " );

// Localizations [added blueasa / 2018-03-28] // need Language Code(ref:https://ko.wikipedia.org/wiki/ISO_639) var arrayLocalizations = plist.root.CreateArray("CFBundleLocalizations"); arrayLocalizations.AddString("en"); // 영어 arrayLocalizations.AddString("ko"); // 한국어

//arrayLocalizations.AddString("zh"); // 중국어

arrayLocalizations.AddString("zh_CN"); // 중국어(간체) : 중국 arrayLocalizations.AddString("zh_TW"); // 중국어(번체) : 대만 arrayLocalizations.AddString("ja"); // 일본어 arrayLocalizations.AddString("de"); // 독일어

// Apply editing settings to Info.plist
plist.WriteToFile (plistPath);
}
}

gist.github.com



[출처] http://smartgames.hatenablog.com/entry/2016/06/19/164052

반응형
Posted by blueasa
, |