Beispiel #1
0
 private void OnEnable()
 {
     Count         = 0;
     timeRemaining = 600;
     if (spawnedObject != null)
     {
         tick.SetActive(false);
         crosss.SetActive(false);
         objectPlaced = false;
         planeDetectionController.SetAllPlanesActive(true);
         Destroy(spawnedObject);
     }
 }
Beispiel #2
0
    private void instantiateEarth(PointerEventData eventData)
    {
        if (m_SessionOrigin.Raycast(Input.GetTouch(0).position, s_Hits, TrackableType.Planes))
        {
            var hit = s_Hits[0];
            spawnedEarth = Instantiate(earthPrefab);

            // Position at one unit (meter/scale applied) above the ground.
            var offset = startingScale * Vector3.up;
            // spawnedObject.transform.SetPositionAndRotation(hit.pose.position + offset, hit.pose.rotation);
            m_SessionOrigin.MakeContentAppearAt(spawnedEarth.transform, hit.pose.position + offset, hit.pose.rotation);
            m_planeDetection.SetAllPlanesActive(false);
            m_planeDetection.RemoveVisualizer();

            // Reactivate terrainController
            if (terrainController != null)
            {
                terrainController.enabled = true;
            }
            // Execute any functions that subcribed to event
            OnInitEnd();
        }
    }