πŸ“± Generic components for use with Unity's AR Foundation package
Branch: master
Clone or download
Latest commit f8b0bb6 Dec 31, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Assets Added support for game object in active set component. Dec 22, 2018
.gitignore Update .gitignore Dec 17, 2018
LICENSE Initial commit. Sep 1, 2018
Makefile Update Makefile Dec 15, 2018
README.md Update README.md Dec 31, 2018

README.md

ARFoundation Components

Features

  • ARDistanceFromPlane
  • ARLightEstimation
  • ARPlaceObjectOnPlane
  • ARPlaneEvents
  • ARShowPlacementMarkerOnPlane
  • ARSetActiveStateOfPlaneVisualsOnEvent
  • SetEnabledStateOfObjectsOnEvent
  • ARFoundationExtensions
    • CenterOfScreen
    • RaycastToPlane
    • IsLookingAtPlane
    • HasTouchedPlane
    • SetActiveStateOfPlaneVisuals

Installation

Unity Package Manager (Unity 2018.3)

https://docs.unity3d.com/Packages/com.unity.package-manager-ui@2.0/manual/index.html

{
    "dependencies": {
        "com.candycoded.arfoundation-components": "https://github.com/CandyCoded/ARFoundation-Components.git#upm",
        "com.candycoded.candycoded": "https://github.com/CandyCoded/CandyCoded.git#v1.1.0"
    }
}

Setup

See https://github.com/CandyCoded/ARFoundation-Components-Demo for a working example of the following steps.

Setup AR Foundation

  1. Install the ARKit XR Plugin and AR Foundation packages from the Package Manager.
  2. Create a new AR Session Origin gameObject from the Create Asset context menu.
  3. Remove the Main Camera gameObject from the hierarchy (as the AR Session Origin contains its own camera).
  4. Create a new AR Session gameObject from the Create Asset context menu.
  5. Create a new AR Default Plane gameObject from the Create Asset context menu, drag it into the Asset panel creating a prefab and then removing it from the hierarchy.
  6. Attach the AR Plane Manager component to the AR Session Origin gameObject and drag the AR Default Plane prefab from the Assets panel into the Plane Prefab property.
  7. Change the Detection Flags to Horizontal (or whatever plane type you will target).

Setup ARFoundation Components

  1. Install both the ARFoundation Components and CandyCoded package (see above).
  2. Attach the AR Plane Events and AR Place Object On Plane components to the AR Session Origin gameObject.
  3. Create a new Cube and set the scale to Vector3(0.1f, 0.1f, 0.1f), drag it into the Asset panel creating a prefab and then removing it from the hierarchy.
  4. Drag the Cube into the Object to Place property of the AR Place Object On Plane component and enable the option Place Multiple.
  5. Create a new event in the Plane Touched with Touch Position event section of the AR Plane Events component.
  6. Drag the AR Session Origin gameObject into the object field of the event.
  7. Select the ARPlaceObjectOnPlane > PlaceObjectOnPlane dynamic method from the dropdown.

Setup iOS build

  1. Check that the scene is in the Build Settings window.
  2. Change the build platform in the Build Settings window to iOS.
  3. In the Player Settings panel, make sure there is a string in the Camera Usage Description field, the Target minimum iOS Version is at least 11, and Architecture is set to ARM64.
  4. When the Unity.XR.ARKit will be stripped dialog pops up, select Yes, fix and build.