コード例 #1
0
ファイル: LevelManager.cs プロジェクト: Roboy/ss18_PocketBoy
 public void PositionGameObjectRelativeToRoboy(GameObject gameObj, Vector3 relativePosition, bool createAnchor = false)
 {
     if (createAnchor)
     {
         var anchor = ARSessionManager.Instance.FloorPlane.CreateAnchor(ARSessionManager.Instance.FloorPlane.CenterPose);
         TemporaryAnchor.Create(anchor, false);
         gameObj.transform.parent = anchor.transform;
     }
     gameObj.transform.position = m_Roboy.transform.TransformPoint(relativePosition);
 }
コード例 #2
0
ファイル: LevelManager.cs プロジェクト: Roboy/ss18_PocketBoy
        private void SpawnRoboy()
        {
            if (RoboyManager.InstanceExists)
            {
                return;
            }

            var plane  = ARSessionManager.Instance.FloorPlane;
            var anchor = plane.CreateAnchor(plane.CenterPose);

            TemporaryAnchor.Create(anchor, true);
            m_Roboy = Instantiate(RoboyPrefab, plane.CenterPose.position, plane.CenterPose.rotation);
            m_Roboy.transform.parent = anchor.transform;
            m_Roboy.Initialize(anchor);
            var face = Instantiate(UnityFacePrefab);

            face.gameObject.transform.SetParent(m_Roboy.ARAnchor.transform);
            SpawnPlanetSystems();
        }