ㅇ1년 정도 더된 글이지만..

http://qiita.com/Dorobou/items/9b71e6621095466083c4


핵심은 


 void Update () {
        if (Input.GetKeyDown (KeyCode.A)) {
            GameObject.Find("Plane").renderer.material.mainTexture = null;
        }
        else if (Input.GetKeyDown (KeyCode.B)) {
            DestroyObject(GameObject.Find("Plane"));
        }
        else if (Input.GetKeyDown (KeyCode.C)) {
            tex = null;
        }
        else if (Input.GetKeyDown (KeyCode.D)) {
            Resources.UnloadAsset(tex);
        }
        else if (Input.GetKeyDown (KeyCode.E)) {
            Resources.UnloadUnusedAssets();
        }
    }



일때


B > C > E 순서로 처리해야 객체의 참조가 전혀 없어지므로 메모리를 해제할 수 있음.




에셋번들 워크플로.


WRITTEN BY
빨강꼬마

,

잘 설명되어 있는 블로그가 있어 남김..


http://developug.blogspot.kr/2014/09/unity-vector-lerp.html


아래 포스팅했던 유니티 Color 클래스에서 제공하고 있는 Lerp 함수도 이와 비슷하고,

NGUI Tween스크립트를 보다보니 Quaternion쪽에서도 Slerp 와 같은 함수도 이와 의미는 같다.



WRITTEN BY
빨강꼬마

,
  1. float duration = 5; // This will be your time in seconds.
  2. float smoothness = 0.02f; // This will determine the smoothness of the lerp. Smaller values are smoother. Really it's the time between updates.
  3. Color currentColor = Color.white; // This is the state of the color in the current interpolation.
  4. void Start()
  5. {
  6. StartCoroutine("LerpColor");
  7. }
  8. IEnumerator LerpColor()
  9. {
  10. float progress = 0; //This float will serve as the 3rd parameter of the lerp function.
  11. float increment = smoothness/duration; //The amount of change to apply.
  12. while(progress < 1)
  13. {
  14. currentColor = Color.Lerp(Color.red, Color.blue, progress);
  15. progress += increment;
  16. yield return new WaitForSeconds(smoothness);
  17. }
  18. return true;
  19. }


출처

http://answers.unity3d.com/questions/328891/controlling-duration-of-colorlerp-in-seconds.html

'Unity > 스크립트' 카테고리의 다른 글

코루틴 문제  (0) 2018.06.21
코루틴과 플래그 처리를 이용한 순차처리 구조.  (0) 2017.11.30
Facebook 초기화시 accesstoken 문제  (0) 2016.08.23
Delegate 비교  (1) 2016.05.17
Unity 에서의 멀티쓰레드 구현  (0) 2016.04.20

WRITTEN BY
빨강꼬마

,