프로그래밍287 UniRx - 튜토리얼 2 그림 UniRx 튜토리얼 2 using UnityEngine; using UniRx; using UniRx.Triggers; // Triggers Namepsace using System; public class TestTrigger : MonoBehaviour { void Start() { // Get the plain object //var obj = GameObject.CreatePrimitive(PrimitiveType.Cube); // 원래 예제는 위에 꺼지만 아래 처럼 그냥 새로운 오브젝트 하나를 생성하는 것으로도 족하다... var obj = new GameObject (); // var 이지만 실은 GameObject 인 obj 에 컴포넌트 ObservableUpdateTrigger 를 부.. 2016. 9. 9. Close Button Event 그림 예제 public Form1() { InitializeComponent(); this.FormClosing += FormClosing_; } protected void FormClosing_(Object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.WindowsShutDown) return; if (this.DialogResult == DialogResult.Cancel) { switch (MessageBox.Show(this, "프로그램을 종료하시겠습니까?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { //Stay on this form case Dialog.. 2016. 9. 5. RX vs2012 에서 설치 1. nuGet 설치 2. 그러나 vs2013 부터만 RX 3.0 지원 3. 어쩔 수 없이 2.0 설치 4. 방법은 아래 PM> install-package protobuf-net -version 2.0.0.668'protobuf-net 2.0.0.668'을(를) 설치하는 중입니다.'protobuf-net 2.0.0.668'을(를) 설치했습니다.'protobuf-net 2.0.0.668'을(를) TGTools에 추가하는 중입니다.TGTools에 'protobuf-net 2.0.0.668'을(를) 추가했습니다. 됐고.. 그냥 여기서 받는게 최고 ㅡㅡ;; https://www.microsoft.com/en-us/download/confirmation.aspx?id=30708 2016. 8. 25. ArrayList 버그 PVMgr.instance.PV_Reset ();ArrayList tmp = new ArrayList ();tmp.Add (GameData.instance.GetHeroData(3));tmp.Add (GameData.instance.GetHeroData(5));tmp.Add (GameData.instance.GetHeroData(9));PVMgr.instance.PvP_AddAlly(0, tmp);ArrayList tmp1 = new ArrayList ();tmp1.Add (GameData.instance.GetHeroData(5));tmp1.Add (GameData.instance.GetHeroData(9));tmp1.Add (GameData.instance.GetHeroData(11));PVMgr.i.. 2016. 1. 22. []배열 꿀 ArrayUtillity FileInfo[] Bytesfiles = directory.GetFiles("*.bytes", SearchOption.AllDirectories);for(int j=0; i 2014. 12. 17. 에셋 번들 빌드 시 계속 1KB 로 생성될 때 리부팅하세요 -_-;; 2014. 12. 16. Unity 3D - StartCorutine 꿀팁 그림 예제 // CoroutineFunc n 개가 동시에 시작 foreach(KeyValuePair tmp in verMap) { ArrayList val = new ArrayList(); val.Add(tmp.Key); val.Add(tmp.Value); StartCoroutine( CoroutineFunc(val) ); } // CoroutineFunc 이 그 전 CoroutineFunc 이 끝나면 차례로 시작 foreach(KeyValuePair tmp in verMap) { ArrayList val = new ArrayList(); val.Add(tmp.Key); val.Add(tmp.Value); yield return StartCoroutine( CoroutineFunc(val) ); } 2014. 11. 28. Unity 3D - InvokeRepeating 함수를 일정 시간 지연 & 시간 텀을 주고 반복 실행 2014. 11. 28. Unity 3D - 안드로이드 기기에서 www.assetBundle.Load 로 다운 안받아질 때 에셋 번들 빌드 할 때 빌드 옵션에서 BuildTarget.Android 확인하세요 개고생 말고 ㅇ_ㅇㅋㅋ 2014. 11. 28. Unity 3D - BuildPipeline AssetDependencies 프로젝트를 진행하다 에셋 번들을 만드는데.. 일반적인 방법으로 제작을 했더니 용량이 어마어마 했다 뭐 보나마나 리소스의 중복이겠지... BuildAssetBundleOptions.CollectDependencies + BuildAssetBundleOptions.CompleteAssets 의 남발 ㅋㅋ 그래서 직접 빌드파이브라인을 건드려서 테스트를 해보기로 했다. 이 기능이 반드시 필요할 텐데 국내나 해외쪽에서도 정보가 그다지 많지 않았다는게 신기... 아니면 너무 쉬운거라 거론할 가치도 없었던 것이거나... (난 바보인가 ㅠ.ㅠ) 실험을 위해 위와 같이 그냥 용량만 큰 bmp 파일 2개로 머티리얼을 제작.. 프리팹 3개에 나눠 쓰잘 때기 없이 중복으 로 써준다 내용은 그냥 머티리얼... 그리고 이 무자비.. 2014. 11. 5. Unity3D - C# string[] list; 오류 string[] list = sFiles.Split('\n'); 별거 없어 보이는 한 줄 이지만.. list 는 늘 null 이었다... list 라는 이름 자체를 사용하면 안되는 것이었다;;; 디버깅도 안된다.. list 라는 예약어가 있었는지 그냥 null 로 자연스럽게;;;;; 2014. 10. 31. Unity3D - Shader Syntex Value http://docs.unity3d.com/Manual/SL-Properties.html 2014. 10. 23. Unity3D - Matrial Shader 교체 http://docs.unity3d.com/ScriptReference/Material-shader.html 간단하니 그냥 들어가서 보자 2014. 10. 23. Unity 3D - C# delegate Dictionary C# 을 다루는건 처음인지라 C++ 에서 잘 써먹던 func map 을 C# 으로 만들어보려고 백방으로 검색을 했으나 나오는게 없어서 그냥 직접 만듬 -_- Dictionary 로 key 값을 참조 동작했으면 하는 function 을 불러오는 구조.. 변수 넘기는건 ArrayList 를 사용해서 어떤 상황에든 다 되게 설계.. 예제 using UnityEngine; using System; using System.Collections; using System.Collections.Generic; public class SystemConsole : MonoBehaviour { public delegate bool Work(ArrayList val); protected Dictionary m_WorkMap .. 2014. 7. 4. Unity3D - sound error maxVolume is not supportedanymore. Use min-, maxDistance and rolloffMode instead. 말고도 중얼중얼 뒤로 더 있는데 생략... 윈도우 환경에서 테스트 중이었다면 볼륨소거 로 해놓지 않았는가 보자... 볼륨소거를 해제하면 이 에러는 나지 않는다.. 다만 안드로이드나 ios 에 들어 갔을 때 그 기기들이 음소거중이라면 어떻게 될까? 2014. 4. 11. Unity3D - Editor 에서의 경로 에디터 프로젝트 창에서 파일을 클릭하고 아래 함수를 이용해서 경로를 추출 하면 AssetDatabase.GetAssetPath(Selection.activeObject); "Assets/선택한오브젝트(폴더)경로" 그리고 Application 에서 지원하는 각종 경로 찾기를 사용하면... Application.dataPath "C:/Users/Public/Documents/Unity Projects/프로젝트명/Assets" Application.persistentDataPath "C:/Users/Neive/AppData/LocalLow/DefaultCompany/프로젝트명" Application.streamingAssetsPath "C:/Users/Public/Documents/Unity Projects/.. 2014. 4. 10. Unity 3D - 스크립트상 프리팹 생성과 삭제 http://docs.unity3d.com/Documentation/ScriptReference/PrefabUtility.html System.IO.Directory.CreateDirectory("Assets/My/New/Directory"); -_-ㅋㅋ 2013. 11. 15. Unity 3D - 주석과 SendMessage 오류 아무리 해도 SendMessage 가 되지 않았다... 한참을 헤메다가 문득... 아.. 주석에 한글 쓰는건 별로 안좋지... (다른 부분에서는 끝에 ... 을 꼭 찍어줬었음...) 원문 // 썩을.. 이렇게 쓰면 다운.. sendMessage OnSkill 중복되면 모호성 생기는 듯 gameObject.SendMessage("OnSubSkill"); 수정 후 // 썩을.. 이렇게 쓰면 다운.. sendMessage OnSkill 중복되면 모호성 생기는 듯... gameObject.SendMessage("OnSubSkill"); 잘된다 ㅡㅡ;;; 조심해야겠다.. 한글 주석... 2013. 11. 11. Unity 3D - 기본 함수 First Scene Load Awake() OnEnable() Before the first frame update Start() In between frames FixedUpdate() Update() LateUpdate() Rendering OnPreCull OnBecameVisible / OnBecameInvisible OnWillRenderObject() OnRenderObject() OnPostRender() OnRenderImage() OnGUI() OnDrawGizmos() Coroutine yield; yield WaitForSeconds(n) yield WaitForFixedUpdate() yield WWW yield StartCoroutine(Func) When the Object i.. 2013. 9. 23. Unity 3D - 두 벡터 사이의 각 두 vector 사이의 각도 구하기- 예를 들면 정면 120' 에 들어오는지 알고 싶다- 예제 bool IsInAngle(Transform target, float fAngle) { Vector3 vRelative = transform.InverseTransformPoint(target.position); float fDeg = Mathf.Atan2 (vRelative.x, vRelative.z) * Mathf.Rad2Deg; if(-fAngle / 2 2013. 8. 30. 이전 1 ··· 5 6 7 8 9 10 11 ··· 15 다음