유니티에서 구글 플레이 서비스 연동을 구현 하는 경우, 아래와 같은 메시지가 유니티의 콘솔창에 뜨는 경우가 있다.

   

(*세부내용)

Google.JarResolver.ResolutionException: Cannot find candidate artifact for com.google.android.gms:play-services-games:9+

at Google.JarResolver.PlayServicesSupport.DependOn (System.String group, System.String artifact, System.String version) [0x00000] in <filename unknown>:0

at GooglePlayGames.Editor.GPGSDependencies.RegisterDependencies () [0x00000] in C:\workspaces\unity\RunningFriends\Assets\GooglePlayGames\Editor\GPGSDependencies.cs:57

at GooglePlayGames.Editor.GPGSDependencies..cctor () [0x00028] in C:\workspaces\unity\RunningFriends\Assets\GooglePlayGames\Editor\GPGSDependencies.cs:49

UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

   

이경우에

  1. 아래의 위치로 가서 Android SDK 위치를 확인한다.
    1. Menu -> Edit -> Preferences -> External Tools -> Android -> SDK

   


 2. 위 사항이 모두 정상적으로 존재하는 경우 SDK Manager 를 실행하여 'Android Support Repository' 와 'Google Repository', 'Google Play Services' 를 업데이트 해준다.

 

3D 모델의 경우 Mesh Renderer 컴포넌트를 가지고 있으며, 여기에는 실시간 그림자에 관여하는 속성이 있다.


- Cast Shadows, Receive Shadows


그림자의 영향을 받지 않아도 되는 모델의 경우 - ex. 손에들고 있는 무기, 총 등...- 해당 옵션을 꺼서 그림자 처리를 하지 않도록 꼭! 수정 하자



카메라 설정 관련 설명을 참조 할만 하여 링크를 걸어둔다.

http://twinbraid.blogspot.kr/2015/02/blog-post_26.html


[출처]

http://hyunity3d.tistory.com/228


유니티 필수 에셋 중에 하나인 아이트윈

유니티에서 물체의 움직임을 보다 쉽게 설정 할 수 있습니다.

유니티를 켜시고 에셋 스토어로 갑시다 ctrl + 9 를 누르면 Asset Store에 들어가집니다.
iTween 으로 검색하시면 아래와 같이 화면이 나오고 다운로드 버튼을 누르고 유니티 상에 import 시켜줍니다. 





파일을 여시면 sample 소스가 존재합니다. sample 소스를 보시면 iTween 이라는게 뭐구나 하고 싶게 이해 할수있으실겁니다.




간단하게 샘플 소스에 대해 알아보겠습니다.




using UnityEngine;

using System.Collections;

 

public class MoveSample : MonoBehaviour

{               

                  void Start(){

                                   iTween.MoveBy(gameObjectiTween.Hash("x"2"easeType""easeInOutExpo""loopType""pingPong","delay".1));

                  }

}


moveSample 입니다.


  • MoveBy(GameObject target, Vector3 amount, float time)
  • MoveBy(GameObject target, Hashtable args)

  • moveBy를 호출하는 방법은 위와 같이 두가지 방법이 있습니다.

    첫번째는 호출 방법은 위치와 시간을 집어넣어주는 함수이고

    두번째는 호출 방법은 해쉬테이블을 집어넣는 방식입니다.


    위함수에서는

    x = 2;

    easeType = "easeInOutExpo"

    loopType = "pingPong"

    delay = .1;

    해쉬테이블의 name 에 각 값들을 집어넣은 것과 같습니다.

    해쉬테이블을 미리 선언하고 아래와 같이 집어넣을 수 도 있습니다.


    Hashtable ht = new Hashtable();
    	
    void Awake(){
    	ht.Add("x",3);
    	ht.Add("time",4);
    	ht.Add("delay",1);
    	ht.Add("onupdate","myUpdateFunction");
    	ht.Add("looptype",iTween.LoopType.pingPong);
    }
    
    void Start(){
    	iTween.MoveTo(gameObject,ht);
    }



    함수의 종류는 아래와 같습니다.


    MoveBy BACK TO TOP

    Adds the supplied coordinates to a GameObject's position.

    • MoveBy(GameObject target, Vector3 amount, float time)
    • MoveBy(GameObject target, Hashtable args)
    Property NameTypePurpose
    namestringan individual name useful for stopping iTweens by name
    amountVector3for a point in space the GameObject will animate to.
    xfloat or doublefor the individual setting of the x axis
    yfloat or doublefor the individual setting of the y axis
    zfloat or doublefor the individual setting of the z axis
    orienttopathbooleanfor whether or not the GameObject will orient to its direction of travel. False by default
    looktargetTransform or Vector3for a target the GameObject will look at
    looktimefloat or doublefor the time in seconds the object will take to look at either the "looktarget" or "orienttopath"
    axisstringrestricts rotation to the supplied axis only
    spaceSpacefor applying the transformation in either the world coordinate or local cordinate system. Defaults to local space
    timefloat or doublefor the time in seconds the animation will take to complete
    speedfloat or doublecan be used instead of time to allow animation based on speed
    delayfloat or doublefor the time in seconds the animation will wait before beginning
    easetypeEaseType or stringfor the shape of the easing curve applied to the animation
    looptypeLoopType or stringfor the type of loop to apply once the animation has completed
    onstartstringfor the name of a function to launch at the beginning of the animation
    onstarttargetGameObjectfor a reference to the GameObject that holds the "onstart" method
    onstartparamsObjectfor arguments to be sent to the "onstart" method
    onupdatestringfor the name of a function to launch on every step of the animation
    onupdatetargetGameObjectfor a reference to the GameObject that holds the "onupdate" method
    onupdateparamsObjectfor arguments to be sent to the "onupdate" method
    oncompletestringfor the name of a function to launch at the end of the animation
    oncompletetargetGameObjectfor a reference to the GameObject that holds the "oncomplete" method
    oncompleteparamsObjectfor arguments to be sent to the "oncomplete" method
    ignoretimescalebooleansetting this to true will allow the animation to continue independent of the current time which is helpful for animating menus after a game has been paused by setting Time.timeScale=0




     

    using UnityEngine;

    using System.Collections;

     

    public class RotateSample : MonoBehaviour

    {               

                      void Start(){

                                       iTween.RotateBy(gameObjectiTween.Hash("x".25"easeType""easeInOutBack""loopType","pingPong""delay".4));

                      }

    }

     

     

    RotateSample 입니다.


    RotateBy BACK TO TOP

    Multiplies supplied values by 360 and rotates a GameObject by calculated amount over time.

    • RotateBy(GameObject target, Vector3 amount, float time)
    • RotateBy(GameObject target, Hashtable args)

    Property NameTypePurpose
    namestringan individual name useful for stopping iTweens by name
    amountVector3for the amount to be multiplied by 360 to rotate the GameObject.
    xfloat or doublefor the individual setting of the x axis
    yfloat or doublefor the individual setting of the y axis
    zfloat or doublefor the individual setting of the z axis
    spaceSpace or stringfor applying the transformation in either the world coordinate or local cordinate system. Defaults to local space.
    timefloat or doublefor the time in seconds the animation will take to complete
    speedfloat or doublecan be used instead of time to allow animation based on speed
    delayfloat or doublefor the time in seconds the animation will wait before beginning
    easetypeEaseType or stringfor the shape of the easing curve applied to the animation
    looptypeLoopType or stringfor the type of loop to apply once the animation has completed
    onstartstringfor the name of a function to launch at the beginning of the animation
    onstarttargetGameObjectfor a reference to the GameObject that holds the "onstart" method
    onstartparamsObjectfor arguments to be sent to the "onstart" method
    onupdatestringfor the name of a function to launch on every step of the animation
    onupdatetargetGameObjectfor a reference to the GameObject that holds the "onupdate" method
    onupdateparamsObjectfor arguments to be sent to the "onupdate" method
    oncompletestringfor the name of a function to launch at the end of the animation
    oncompletetargetGameObjectfor a reference to the GameObject that holds the "oncomplete" method
    oncompleteparamsObjectfor arguments to be sent to the "oncomplete" method
    ignoretimescalebooleansetting this to true will allow the animation to continue independent of the current time which is helpful for animating menus after a game has been paused by setting Time.timeScale=0











    보다 많은 정보는 iTwwen 홈페이지에서 찾아볼수있습니다.

    ITwen 홈페이지 :http://itween.pixelplacement.com/index.php


    관련 동영상 강좌 입니다.


    http://www.youtube.com/watch?v=qRafXt26a_E

    http://www.youtube.com/watch?v=qE5hpp4YaH4


    http://www.youtube.com/watch?v=hbSxwoWjBgQ -> 한글



    Character Controller 의 속성

    1. Slop Limit : 경사로를 등반할 수 있는 최대각

    2. Step Offset : 올라갈 수 있는 계단의 높이 설정
    - 2미터 신장기준 0.1 ~ 0.4 가 최적

    3. Skin Width : 갇히는 현상(Stuck)을 방지하기 위한 설정 Capsule Collider 의 반지름의 10% 정도가 최적

    4. Min Move Distance : 설정값 이하로 움직이려 할 때 이동 할 수 없게 하는 옵션

    5. Center : Capsule collider 의 위치를 설정하는 옵션

    6. Radius : Capsule collider 의 반지름을 설정하는 옵션

    7. Height : 모델의 스케일에 맞게 Capsule collider 의 높이 설정

    클래스 상단에 아래 그림과 같이

    [RequireComponent(typeof(AudioSource))] 를 명시하게 되면 AudioSource 컴포넌트의 경우 삭제 할 수 없다.

    'unity' 카테고리의 다른 글

    iTween  (0) 2015.12.21
    Character Controller 의 속성  (0) 2015.12.06
    Particle Auto destroying - 파티클 자동 삭제  (1) 2015.12.02
    스크립트 컴파일 우선순위 설정  (0) 2015.12.02
    Collider 의 Is Trigger 속성  (0) 2015.12.02
    5.0 부터 파티클 시스템에 자동 삭제 체크박스가 없다.

    대신 아래의 스크립트를 파티클에 추가하면 해당 파티클의 수명이 다한 경우 자동으로 삭제가 된다.


    1. 스크립트 컴파일 시 Standard Assets 폴더에 있는 스크립트가 먼저 컴파일 된다.

    - C# 에서 자바스크립트로 접근시에는 반드시 이 폴더에 C# 스크립트가 위치 해야 한다.

    2. 직접 스크립트 컴파일의 우선 순위를 설정하는 경우

    - Editor -> Project Settings -> "Script Execution Order" 로 진입한다.


    3. Inspector 창에 아래와 같은 내용이 표시된다.


    4. '+' 를 눌러 팝업에서 조정하고자 하는 스크립트를 추가한다.

    (+ 를 누르면 아래와 같은 리스트 팝업이 뜬다.)


    5. 각 스크립트 별로 가중치를 조정한다.


    Collider 컴포넌트의 'Is Trigger' 속성을 체크하게 되면 충돌 감지는 되지만, 물리적인 충돌은 발생하지 않는 옵션이다.

    이때 발생하는 이벤트는

    OnTriggerEnter, OnTriggerStay, OnTriggerExit 이다.


    'unity' 카테고리의 다른 글

    Particle Auto destroying - 파티클 자동 삭제  (1) 2015.12.02
    스크립트 컴파일 우선순위 설정  (0) 2015.12.02
    충돌 감지 조건  (0) 2015.12.02
    Unity 와 Visual Studio 연결(연동)  (0) 2015.12.01
    유니티 주요 함수 정리  (0) 2015.11.30

    1. 두 게임 오브젝트 중 움직이는 쪽에는 Rigidbody 컴포넌트가 있어야 한다.

    2. 양쪽 게임오브젝트 모두 Collider 컴포넌트가 있어야 한다.

    'unity' 카테고리의 다른 글

    스크립트 컴파일 우선순위 설정  (0) 2015.12.02
    Collider 의 Is Trigger 속성  (0) 2015.12.02
    Unity 와 Visual Studio 연결(연동)  (0) 2015.12.01
    유니티 주요 함수 정리  (0) 2015.11.30
    텍스쳐의 적용  (0) 2015.11.29

    + Recent posts