void Test_OnTrigger()
{
    Rigidbody rigidBody = GetComponent<Rigidbody>();
    // OnTrigger
    Debug.Log("---------------------------------------------------------------------------------------------------");
    Debug.Log("OnTrigger Enter/Stay/Exit AsObservable Test");
    bool zoneFlag = false;
    // 플래그가 유효한 동안 위쪽으로 힘을 가하면 
    this.FixedUpdateAsObservable()
        .Where(_ => zoneFlag)
        .Subscribe(_ => rigidBody.AddForce(Vector3.up));
    // Zone에 들어오면 하면 플래그를 활성화
    this.OnTriggerEnterAsObservable()
        .Where(x => x.gameObject.tag == "Zone")
        .Subscribe(_ => { 
            zoneFlag = true;
            Debug.Log("Zone Enter");
        });
    this.OnTriggerStayAsObservable()
        .Where(x => x.gameObject.tag == "Zone")
        .Subscribe(_ => { 
            Debug.Log("Zone Stay");
        });
    // Zone에서 나가면 플래그를 해제 
    this.OnTriggerExitAsObservable()
        .Where(x => x.gameObject.tag == "Zone")
        .Subscribe(_ => { 
            zoneFlag = false;
            Debug.Log("Zone Exit");
        });
}
피드 구독하기:
댓글 (Atom)
- 
대상이 되는 이미지를 SVG(Scalable Vector Graphics) 이미지로 변환 - 각종 툴이나 웹상에서 바로 바꿔주는 다양한 방법이 있음(검색 검색~) - 찾은거 하나 : http://image.online-convert.com/c...
- 
mitmproxy( man in the middle proxy) 설치 메모 https://mitmproxy.org/ 에서 설치 방법 확인 brew를 사용해서 설치 진행 - $ brew install mitmproxy - 설치후...
- 
CommandBuffer를 사용하여 Gray Post Effect 효과를 적용해보는 Simple code... 일단 보여지는 결과는... 실행전 실행후 CommmandBuffer를 이용한 C#예제 소스 using ...
 
 
 
 
댓글 없음:
댓글 쓰기