Get it on Google Play


Wm뮤 :: '분류 전체보기' 카테고리의 글 목록 (62 Page)

블로그 이미지
가끔 그림그리거나 3D모델링하거나
취미로 로봇만드는
전자과 게임프로그래머 (퇴사함)
2022.3.22f1 주로 사용
모카쨩
@Ahzkwid

Recent Comment

Archive


2021. 5. 15. 01:07 Unity

 

 

 

 

 

OVR Grabber : 픽업기능의 손에 해당하는부분. Layer는 Default여야하고(간섭가능) 콜라이더가 붙어있어야 하며

    Player와 GripTransform이 할당되어 있어야한다

OVR Grabbable : 픽업기능의 물건에 해당하는 부분. 단점은 아무런 표시가 안되어서 아웃라인같은건 수동으로 해줘야하고 한번 놓친 물건은 손에서 떨어질때까지 집을수없다 에휴

    OVR Grabber가 있어야 쓸수있다

DistanceGrabbable : 멀리떨어진거도 집을수 있게해줌, DistanceGrabber가 있어야 쓸수있다.(왜?) DistanceGrabHand프리팹을 쓰면 편하다

OVRRaycaster : 레이저로 캔버스를 쓸수있게해줌

 

 

 

 

 

 

프리팹

OVRPlayerController : 이게 있어야 손하고 머리가 움직임

개꾸진 SnapRotation과 하위의 OVRCameraRig에서 Tracking Origin Type을 Floor Level로 바꿔주자

 

 

 

OVRControllerPrefab : 손위치를 표시해주는 프리팹(컨트롤러모양), 필수는 아니지만 있으면 좋음. 옵션은 L Touch, R Touch 쓰자

 

 

반대쪽도 동일하게


CustomHandLeft : 손위치를 표시해주는 프리팹(손모양), OVRCustomHandPrefab이랑 헷갈리지 않게 주의

 이 이상한 컴포넌트는 기존 Grabber를 지워야하고 픽업좌표가 쉽게 꼬이기에 Grip Transform을 바꿔주자

그리고 Grabber의 Parent Held를 켜주자. 이래야 이동할때도 잘 따라온다

 

 

 

 

 

 

 

 

 

 

 

'Unity' 카테고리의 다른 글

유니티 VR 세팅관련  (0) 2021.05.15
유니티 오큘러스퀘스트 세팅  (0) 2021.05.14
유니티 동영상 촬영, 스크린샷 캡쳐  (0) 2021.03.18
posted by 모카쨩
2021. 5. 14. 23:47 Unity

오큘러스 개발자등록을 한다

https://developer.oculus.com/?locale=ko_KR 

 

Oculus Developer Center | Overview

아이디어를 현실로 만드는 기술 즐겨 사용하는 게임 엔진 또는 Oculus의 네이티브 SDK를 통해 전체 Oculus 플랫폼에서 손쉽게 가상 현실 게임, 소셜 경험, 엔터테인먼트 또는 교육 앱 등을 개발해보

developer.oculus.com

 

이거 안하면 퀘스트에 앱을 못 올린다

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

오큘앱에서 활성화 해준다.

이거없으면 퀘스트실행이 안되니까 다들 하나씩 있을것이다

 

 

그리고 퀘스트를 usb로 pc랑 연결해서 usb디버깅과 파일접근 모두 허용한다

 

 

 

 

 

 

 

 

 

 

나중에 앱관리가 어려우니 패키지네임은 신중하게 써 넣는다

 

 

 

 

 

 

https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022

 

Oculus Integration | 기능 통합 | Unity Asset Store

Use the Oculus Integration from Oculus on your next project. Find this integration tool & more on the Unity Asset Store.

assetstore.unity.com

 

깐다

 

 

 

 

 

 

'Unity' 카테고리의 다른 글

오큘러스 컴포넌트 및 프리팹  (0) 2021.05.15
유니티 동영상 촬영, 스크린샷 캡쳐  (0) 2021.03.18
유니티 애드몹 2021  (2) 2021.03.01
posted by 모카쨩
2021. 5. 11. 01:48 게임/VRChat

 

 

오큘스토어에 보면 vrchat이 없다. 한국은 막혀있기 때문이다

 

스마트폰에서 vpn을 이용한 우회설치를 해야한다

 

 

 

 

 

구글플레이에서 vpn을 다운받는다

 

 

 

 

폰에서 설치를 누르면 헤드셋에서 자동으로 설치가 된다

 

 

 

 

 

다 썼으면 우측하단 중지버튼눌러서 끄고 vpn을 지우자

'게임 > VRChat' 카테고리의 다른 글

VRChat SDK 오류 모음  (0) 2021.07.24
오큘러스 리프트 컨트롤러 쏠림 수리방법  (1) 2021.04.21
VRChat 월드계열 API 모음  (0) 2021.04.10
posted by 모카쨩
2021. 5. 3. 18:33

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2021. 5. 3. 10:14 애플/스위프트

 

 

 

 

 

 

'애플 > 스위프트' 카테고리의 다른 글

아이폰 무선빌드  (0) 2022.06.18
유니티 스위프트 Unity Swift  (0) 2021.04.28
posted by 모카쨩
2021. 4. 30. 18:55

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2021. 4. 29. 12:58

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

2021. 4. 28. 17:50 애플/스위프트

 

 

 

2019.3 버전일경우

stackoverflow.com/questions/31636408/write-unity-ios-plugin-in-swift-code

 

이후버전일경우 참고자료

qiita.com/mao_/items/2305822054dadb2c5da8

qiita.com/ohbashunsuke/items/8f3b7c733fc70a180941

 

 

 

유니티 내부에 세가지 파일을 만들어 준다

Plugins/iOS/Bridge.mm

Plugins/iOS/SwiftTest.swift

Scriptes/SwiftTest.cs

 

 

Bridge.mm과 SwiftTest.swift는 텍스트문서를 이용해 만들고 확장자를 바꿔준다.

 

 

 

그리고 아래같이 입력해준다

Bridge.mm과 SwiftTest.swift는 텍스트문서로 열거나 IDE로 열면 된다.

//SwiftTest.cs

using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;

public class SwiftTest : MonoBehaviour
{
    [DllImport("__Internal")]
    private static extern void callSwiftTestFunc();

    void Start()
    {
        Press();
    }


    public void Press()
    {
        callSwiftTestFunc();
    }
}
//Bridge.mm
#import <UnityFramework/UnityFramework-Swift.h>

extern "C" {
  void callSwiftTestFunc() {
      [SwiftTest testFunc];
  }
}
//SwiftTest.swift

import Foundation

@objc public class SwiftTest : NSObject {
    @objc public static func testFunc() {
        print("Swift Test")
    }
}

 

 

 

 

빌드하고 실행해서 실행해보면 다음과 같이 xcode 로그에 뜬다

 

 

 

 

 

 

 

 

인자받을수 있게 개조할것이다

//SwiftTest.cs

using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;

public class SwiftTest : MonoBehaviour
{
    [DllImport("__Internal")]
    private static extern void callSwiftTestFunc();


    [DllImport("__Internal")]
    private static extern void callSwiftTestFunc2(string text);


    void Start()
    {
        Press();
    }


    public void Press()
    {
        callSwiftTestFunc();
        callSwiftTestFunc2(Time.time.ToString());
    }
}
//Bridge.mm
#import <Foundation/Foundation.h>
#import <UnityFramework/UnityFramework-Swift.h>

extern "C" {
  void callSwiftTestFunc() {
      [SwiftTest testFunc];
  }
  void callSwiftTestFunc2(const char *text) {
      [SwiftTest testFunc2 :[NSString stringWithUTF8String:text]];
  }
}
//SwiftTest.swift

import Foundation

@objc public class SwiftTest : NSObject {
    @objc public static func testFunc() {
        print("Swift Test")
    }
    @objc public static func testFunc2(_ text: String) {
        print("Swift Test2\(text)")
    }

}

 

 

 

결과

 

 

 

 

하지만 함수는 리턴값이 있어야 쓸만하지 않은가

그래서 한번 더 개조했다

참고한곳 : stackoverflow.com/questions/37047781/how-to-return-string-from-native-ios-plugin-to-unity

//SwiftTest.cs

using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.UI;

public class SwiftTest : MonoBehaviour
{
    [DllImport("__Internal")]
    private static extern void callSwiftTestFunc();


    [DllImport("__Internal")]
    private static extern void callSwiftTestFunc2(string text);



    [DllImport("__Internal")]
    private static extern int callSwiftTestFunc3();


    [DllImport("__Internal")]
    private static extern string callSwiftTestFunc4();




    public Text UItext;


    void Start()
    {
    }


    public void Press()
    {
        callSwiftTestFunc();
        callSwiftTestFunc2(Time.time.ToString());
        UItext.text = callSwiftTestFunc3().ToString();
        UItext.text +="\n"+callSwiftTestFunc4().ToString();
    }
}
//Bridge.mm


#import <Foundation/Foundation.h>
#import <UnityFramework/UnityFramework-Swift.h>

extern "C" {
  void callSwiftTestFunc() 
  {
      [SwiftTest testFunc];
  }
  
  void callSwiftTestFunc2(const char *text) 
  {
      [SwiftTest testFunc2 :[NSString stringWithUTF8String:text]];
  }
  
  int callSwiftTestFunc3()
  {
      return [SwiftTest testFunc3];
  }
  
  
  
  
  char* callSwiftTestFunc4() 
  {
	  NSString* nsStr=[SwiftTest testFunc4];
	  const char* nsStrUTF8=(char*)[nsStr UTF8String];
	  char* cString=(char*)malloc(strlen(nsStrUTF8)+1);
	  strcpy(cString, nsStrUTF8);
      return cString;
  }
}
import Foundation

@objc public class SwiftTest : NSObject 
{
    @objc public static func testFunc() 
	{
        print("Swift Test")
    }
	
    @objc public static func testFunc2(_ text: String) 
	{
        print("Swift Test2\(text)")
    }
	
    @objc public static func testFunc3() -> Int 
	{
        print("testFunc3")
        return (Int)(NSDate().timeIntervalSince1970)
    }

    @objc public static func testFunc4() -> String 
	{
        print("testFunc4")
		let dateFormatter = DateFormatter()
		dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
        return dateFormatter.string(from:Date())
    }
}

 

 

잘된다

 

 

'애플 > 스위프트' 카테고리의 다른 글

아이폰 무선빌드  (0) 2022.06.18
스위프트 정적 라이브러리 생성방법  (0) 2021.05.03
posted by 모카쨩

저사양 유저용 블로그 진입