안드로이드 SDK 오류 날때 Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.

Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. 오류날때 저도 동일한 문제로 헤매다가  http://answers.unity3d.com/questions/1320150/unable-to-list-target-platform.html   참고하여 해결했습니다.  위 링크 들어가 보시면 댓글에 해결책이 있는데  여기에 요약하면  Android SDK tools 가 최신 버전(25.3.1)으로 업데이트 되면서 unity가 사용하던 기능이 없어진거 같다고 합니다.  해결책은 기존 Android SDK설치 폴더에서 tools 폴더 이름을 변경한 후 [Your Android SDK root]/tools -> toolsXXXX   http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip  를 다운로드 받아서 압축 풀고 해당 tools 폴더를 위의  Android SDK설치 폴더에 복사합니다. 그러면 unity에서 예전처럼 잘 됩니다. http://www.devkorea.co.kr/bbs/board.php?bo_table=m03_qna&wr_id=79671

dot 형식의 마스크 애니메이션 ( 셰이더 )

이미지
DOT 형식의 마스크 애니메이션을 할 수 있을까 싶어서 셰이더로 만들어 봤다. 장점은 DOT이 아무리 늘어나도 부하가 걸리지 않는 다는 것이다. TEXTURE의 TILE만 늘려주면 되니까! 사용된 텍스쳐들 마스크 이미지. Shader   "Custom/flip_Vertex"  { Properties  { _Color ( "Color" , Color) = (1,1,1,1) _MainTex ( "Albedo (RGB)" , 2D) =  "white"  {} _AlphaTex( "Alpha Tex" , 2D) =  "white"  {} _MaskTex( "Mask Tex" , 2D) =  "white"  {} _AnimRange( "Value" ,Range(-10,10)) = 5 _Angle( "Angle" , Range(-5.0,  5.0)) = 0.0     } SubShader  { Tags  {  "RenderType" = "Opaque"   "Queue" = "Transparent" } cull back CGPROGRAM #pragma  surface surf Lambert vertex:vert noshadow  alpha:fade sampler2D  _MainTex; sampler2D  _AlphaTex; sampler2D  _MaskTex; float  _AnimRange; float  _Angle; fixed4 ...
이미지

GetSpectrumData 사운드에 맞춰 게임오브젝트의 형태 변환

이미지
using  UnityEngine; using  System.Collections; public   class   soundMag  :  MonoBehaviour  {      AudioSource  audio;      float [] spectrum =  new   float [64];      public   GameObject  cube;           void  Start () {         audio = GetComponent< AudioSource >(); } void  Update () {         MusicVisualization();     }           void  MusicVisualization()     {         audio.GetSpectrumData(spectrum, 0,  FFTWindow .BlackmanHarris);         cube.transform.localScale =  new   Vector3 (1,...

유니티 에티터 곡선 연결 노드 만들기

http://gamedevst.tistory.com/category/Unity5

타겟방향을 따라 회전 하기

using  UnityEngine; using  System.Collections; public   class   test_rotation  :  MonoBehaviour  {      public   Transform  target;      Vector3  lookDir;      void  Start () { } void  Update () {                   // 방향은 노멀라이즈 사용         lookDir = (target.position - transform.position).normalized;          Quaternion  from = transform.rotation;          Quaternion  to =  Quaternion .LookRotation(lookDir);         transform.rotation =  Quaternion .Lerp(from, to,  Time .fixedDeltaTime); } }

프레임 레이트 화면에 표시 하기 fps display

http://wiki.unity3d.com/index.php?title=FramesPerSecond 프레임 레이트 화면에 표시 하기 using UnityEngine ; using System.Collections ;   public class FPSDisplay : MonoBehaviour { float deltaTime = 0 . 0f ;   void Update ( ) { deltaTime += ( Time . deltaTime - deltaTime ) * 0 . 1f ; }   void OnGUI ( ) { int w = Screen . width , h = Screen . height ;   GUIStyle style = new GUIStyle ( ) ;   Rect rect = new Rect ( 0 , 0 , w, h * 2 / 100 ) ; style . alignment = TextAnchor . UpperLeft ; style . fontSize = h * 2 / 100 ; style . normal . textColor = new Color ( 0 . 0f, 0 . 0f, 0 . 5f, 1 . 0f ) ; float msec = deltaTime * 1000 . 0f ; float fps = 1 . 0f / deltaTime ; string text = string . Format ( "{0:0.0} ms ({1:0.} fps)" , msec, fps ) ; GUI . Label ( rect, text, style ) ; } }