예제 #1
0
파일: CloseMenu.cs 프로젝트: Tibec/ProjectO
    void OnRemoteCollisionExit(CollisionListenerData data)
    {
        if (data.collision.tag != "Player")
        {
            return;
        }

        if (data.sender == LeftStartClose.gameObject && currentState == eState.FollowLeft)
        {
            currentState = eState.SlideBack;
        }
        if (data.sender == RightStartClose.gameObject && currentState == eState.FollowRight)
        {
            currentState = eState.SlideBack;
        }
    }
예제 #2
0
파일: CloseMenu.cs 프로젝트: Tibec/ProjectO
    void OnRemoteCollisionEnter(CollisionListenerData data)
    {
        if (data.collision.tag != "Player")
        {
            return;
        }

        if (data.sender == LeftStartClose.gameObject && currentState == eState.None)
        {
            currentState = eState.FollowLeft;
            activeHand   = data.collision.transform;
        }
        if (data.sender == RightStartClose.gameObject && currentState == eState.None)
        {
            currentState = eState.FollowRight;
            activeHand   = data.collision.transform;
        }
        if (data.sender == EndClose.gameObject &&
            (currentState == eState.FollowLeft || currentState == eState.FollowRight))
        {
            //gameObject.SetActive(false);
            Destroy(gameObject);
        }
    }