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

카테고리

분류 전체보기 (2843)
Unity3D (891)
Programming (479)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (188)
협업 (64)
3DS Max (3)
Game (12)
Utility (140)
Etc (99)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (52)
Android (16)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (19)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday

출처: http://beatup.springnote.com/pages/3277191


BPM : beat per min 의 준말.  즉 분당 비트수로써 1분당 1/4박자의 갯수이다.

- 1분당 BPM별 비트 갯수

 BPM1/4 박자1/8박자 1/16박자 1/32박자 
 60 BPM 60 개 120 개 240 개 480 개
 100 BPM 100 개 200 개 400 개 800 개
 130 BPM 130 개 260 개 520 개 1040 개
 155 BPM 155 개 310 개 620 개 1240 개


즉, 우리가 만들 게임은 1/32박자 (이하 32비트) 게임이므로
155bpm시 1분당 최대 1240개의 노트가 들어간다.



이제 노트 하나당 간격을 알아보도록 하자.

60bpm에서 4비트는 1초마다 1비트가 올라가므로 최대 60개가 나온다.
그럼 1/8박자는 0.5초마다, 16박자는 0.25초마다, 32박자는 0.125초마다 1비트가 오른다.

130bpm의 32비트는 최대 1040개이므로 비트 하나당 간격을 알아보자.
소수점자리까지 사용하므로 총 8자리까지 쓰고 이하는 반올림을 기준으로 한다.

130 / 60 = 2.16666667
0.125 / 2.1666 = 0.05769230

 


노트는 0.05869230초마다 나오며 이 값이 맞는지 최대 비트인 1040개와 계산을 해보자

 0.05769230 * 1040 = 59.999992


얼추 60이 맞는것을 알수 있다.
더 낮은 자리까지 계산을 하면 정확해지며 이게 정확하지 않다면 음악이 재생시간이
길어질수록 비트는 조금씩 밀리거나 당겨지는 현상이 있을수가 있으므로 주의하기 바란다.


이 문제를 해결하려면 10초마다 실행하는 타이머를 주어 다음 10초간의 비트의 위치를
부분적으로 계산하면 될듯싶다.

60bpm시 부분 계산 방식

 플레이시간읽는 비트 
 0:00 0 - 80 
 0:10 80 - 160
 0:20 160 - 240
 0:30 240 - 320
 0:40 320 - 400
 0:50 400 - 480



화살표(노트) 이동 속도의 구현
60bpm은 매우 느린 속도이다.
120bpm은 60bpm의 2배의 속도이다.
180bpm은 60bpm의 3배의 속도이다. 

 bpm 픽셀당이동속도 
 1 bpm 1 초
 60 bpm 0.00166667 초
 120 bpm 0.00083333 초
 180 bpm 0.00055556 초


픽셀은 구현이 어떤식으로 되는지 모르기에 예를 든것이다.
구현 방법에 따라 적절히 하도록 바람.




 



여기까지 bpm 계산 방법을 알아 보았다.
이제 배속의 구현을 알아보도록 하자.

먼저 bpm 공식에 의거하여 노트는 기본적인 이동속도를 가진다.
이것은 1배속이 된다.

60 bpm이 0.00166667 초에 1픽셀을 이동하는데
만약 2배속일경우엔 0.00083333 초에 1픽셀을 이동한다.

그러나 배속은 비트에 대해 절대 영향을 끼치지 않으며 단순히 이동속도만을 제어한다.



[출처] http://smilejsu.tistory.com/380

반응형
Posted by blueasa
, |

펌 OK (출처 표시), 상업적 이용 NO, 컨텐츠 변경 NO

apk파일을 디컴파일하게되면 원본 소스코드를 100%는 아니더라도 확인이 가능하다.

다만, 소스코드 난독화(proguard등)가 적용되어 있다면 코드의 해석은 상당히 힘들게된다.

그럼에도 불구하고 필요한 소스코드가 있다면 디컴파일하여 쓸만한 건덕지를 찾아봐야하니 디컴파일은 중요하다고

할 수 있다. (개발자의 경우 상당히 기분나쁜부분, 우리는 참고용으로만 사용하자)

디컴파일 전에 몇가지 준비사항이 필요하다.


1. https://code.google.com/p/dex2jar/downloads/list 

여기서 dex2jar 다운로드 > 

C:\Program Files\adt-bundle-windows-x86_64-20130522\sdk\platform-tools\dex2jar-0.0.9.15 경로에 압축해제 

(위 경로는 본인의 경우이고, sdk가 있는 경로상에 집어넣어주면 된다.)

dex2jar.bat 파일 우클릭 후 편집 > echo off 를 echo on 으로 수정



2. http://varaneckas.com/jad/

여기서 최신버전 Jad (자바 디컴파일러) 다운로드 > 압축해제


이제 디컴파일 준비는 끝났다.


시작




- 우선 디컴파일할 apk파일의 확장자를 apk 에서 zip로 바꾸면 zip파일이 된다.

- 압축해제하면 classes.dex 파일이 나온다. 이것만 있으면 된다






그렇게 나온 classes.dex 파일을

아까 받은 dex2jar 폴더로 이동시킨다





그리고 현재 위치의 경로를 복사 한 뒤

시작 > 실행 > cmd > cd적은다음 한칸띄고 마우스 우클릭 > 붙여넣기 > 엔터 하면

위의 경로로 이동





이제 d2j-dex2jar.bat classes.dex를 적고 엔터를 누르면 사진과같이 이상한글이 쫘르륵 나오고

경로에 classes-dex2jar.jar 파일이 생성된다.

버전에 따라 d2j-dex2jar.bat가 아니라 dex2jar.bat 인경우도 있는듯 하니 파일명을 잘보고 알아서 입력한다


그리고 생성된 파일을 압축해제하면 클래스파일들이 나오게 된다.




필자는 proguard를 적용한 apk를 사용했기때문에 보는바와같이 클래스명이 저렇게 지맘대로다.

이제 MainActivity.class를 java파일로 변환해줘야 소스코드를 확인할 수 있다.


MainActivity.class파일을 복사하여 2번에서 설치한 Jad가 설치된 경로에 붙여넣어준다





그리고





다시 시작 > 실행 > cmd > jad 경로로 이동 후


jad -o -sjava MainActivity.class  엔터




그러면 이렇게 MainActivity.java 파일이 생긴다 ! 실행해보자




다시말하지만 필자는 코드난독화(proguard)를 적용했기에 변수명이 이렇게 알아먹기 힘들게 표시된다.

(적용하지 않으면 대부분의 소스코드를 볼 수 있다)

오랜시간 해석한다면 불가능하진 않지만 상당한 곤욕을 치루는것은 어쩔 수 없다.


proguard에 관한 포스팅은 이전글을 참고하길 바라며


-끝-


[출처] http://biig.tistory.com/11

반응형
Posted by blueasa
, |


[링크] http://evir.tistory.com/entry/Unity-Vungle-Plugin-%EC%84%A4%EC%B9%98

반응형
Posted by blueasa
, |


[링크] 

http://evir.tistory.com/entry/Unity-Google-Play-Game-Service-%EC%97%B0%EB%8F%99%EC%8B%9C%ED%82%A4%EA%B8%B0

반응형

'Unity3D > Link' 카테고리의 다른 글

[링크] 캐릭터/애니메이션 판매 사이트(유니티 사용 가능)  (0) 2020.06.18
[Asset] 2D Outline  (0) 2018.05.21
[Link] RhythmTool  (0) 2016.06.21
[Link] Visualizer Studio  (0) 2016.06.21
[Link] Unity 3 Audio Spectrum Analysis  (0) 2016.06.21
Posted by blueasa
, |


[링크] http://evir.tistory.com/entry/Unity-Google-AdMob-Plugin-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0

반응형
Posted by blueasa
, |

Unity Ads 연동

Unity3D/Ad / 2016. 7. 26. 14:32


[링크] http://evir.tistory.com/entry/Unity-Unity-Ads-%EC%97%B0%EB%8F%99

반응형
Posted by blueasa
, |


[수정]


위 스크린샷에서 "RewardedVideo"로 수정하라고 돼 있는데,

"rewardedVideo"로 첫자가 소문자로 시작해야 됨.


반응형
Posted by blueasa
, |


[링크] https://github.com/kimsama/Unity5-AssetBundleSetting

반응형

'Unity3D > AssetBundle' 카테고리의 다른 글

[펌] 에셋번들 생성하기 & 다운로드  (0) 2017.04.12
[링크] 에셋번들 로딩 방식 4가지  (0) 2017.03.03
WWW.LoadFromCacheOrDownload  (0) 2015.04.23
AssetBundle 가이드  (0) 2015.01.26
AssetBundle 버전체크 방식..  (0) 2014.04.21
Posted by blueasa
, |

[링크] http://www.stuffkorea.com/bbs/board.php?bo_table=features&wr_id=479

반응형
Posted by blueasa
, |

- Unity 5.3 기준 처음보는 Custom Coroutine 이 추가돼 있길래 남겨 놓음

  = WaitWhile()

  = WaitUntil()



Among all the shiny new features, there is a tiny one line in the Unity 5.3 release notes for a feature that I found useful and I think you will too. Custom coroutines, namely the new CustomYieldInstruction class, mean that you can now add your own coroutine yield operations in a very simple way. So let’s take a look at a real world example.

A real world example – A bugfix

I was recently investigating a bug in the UI Dropdown component, a Unity 5.2 feature. When Time.timescale was set to 0, the Dropdown component would only work once, then it would not reappear until timescale was set back to a non-zero value.

After a bit of debugging, we found out that the problem is in the Show function.

2

m_Dropdown is not null and is preventing the Dropdown from being shown.

Once shown, the m_Dropdown component is minimised and then destroyed. Well, it should be destroyed, but when the timescale is 0, this is not happening.

Take a look at the destroy function and see if you can spot the problem.

1

The title of this article may have given it away, but WaitForSeconds is the answer. WaitForSeconds uses scaled time. This means that if you tell WaitForSeconds to wait for 1 second and the timescale is 0.5, then you actually wait for 2 seconds (1 / 0.5 = 2). So using WaitForSeconds with a timescale of 0 means that you wait indefinitely (until the timescale is not 0). The Dropdown was never being destroyed after its first use, because we would get held up by the WaitForSeconds yield instruction.

The solution

We need to wait using unscaled time; the most elegant approach here is to add a new yield operation, a WaitForSecondsRealtime class. Clearly, if our own developers do not realise WaitForSeconds uses scaled time, then we need to address this. WaitForSecondsRealtime  should help reinforce this message. We also need to update the docs for WaitForSeconds (we never mention scaled time!).

This is how I discovered the CustomYieldInstruction, recently added for creating new yield operations.

Adding a new yield operation is very simple, here is the solution to our problem.

3

Any custom yield operation needs to override the keepWaiting property and once we want the yield operation to continue, we just pass back false.

Here is how our fix now looks:

4

In our example, we grab the real time and just test against it each check. It doesn’t get much simpler than that – oh wait, it does, because we now also have the WaitUntil and WaitWhile yield instructions. With these, we can provide a delegate to be called for our yield instruction test.

Here is an alternative way to solve our problem, assuming we wanted a 5 second delay.

5

So, a simple feature, but with a lot of potential. I guess the lesson learned here is: Remember to read the release notes, you never know what useful features you might find! If you like the custom coroutines, you should take a look at UnityEvents, another favourite feature of mine that you may have missed.




[출처] http://blogs.unity3d.com/kr/2015/12/01/custom-coroutines/


[참조] http://tsubakit1.hateblo.jp/entry/2015/12/09/000000

반응형
Posted by blueasa
, |