Esempio n. 1
0
    public void BeginGame()
    {
        GameBegun = true;
        Vector3 origin = Vector3.forward;

        #if !UNITY_EDITOR
        origin = GameObject.FindWithTag("SkeletonOriginMarker").transform.position;
        #endif

        skeletonScatter.transform.position = origin;

        skeletonScatter.gameObject.SetActive(true);
        StartCoroutine(GenericCoroutines.DoAfterSeconds(() =>
        {
            skeletonScatter.ScatterSkeleton();
            skeletonManager.gameObject.SetActive(true);
            skeletonManager.transform.position = origin;
        }, 2));

        Instantiate(welbyOriginPrefab).transform.position = origin;


        ARPlaneManager arpm = FindObjectOfType <ARPlaneManager>();
        arpm.SetTrackablesActive(false);
        arpm.enabled = false;
        ARPointCloudManager arpcm = FindObjectOfType <ARPointCloudManager>();
        arpcm.SetTrackablesActive(false);
        arpcm.enabled = false;
        PlaceOnPlane placeOnPlane = FindObjectOfType <PlaceOnPlane>();
        placeOnPlane.enabled = false;
        placeOnPlane.placedPrefab.SetActive(false);
    }
Esempio n. 2
0
 public void StartNewGame()
 {
     placeOnPlane = GetComponent <PlaceOnPlane>();
     Destroy(placeOnPlane);
     startGame.gameObject.SetActive(false);
     CrossHair.gameObject.SetActive(true);
     shootButton.gameObject.SetActive(true);
 }
    void Start()
    {
        placement = FindObjectOfType <PlaceOnPlane>();

        var root = placementControls.rootVisualElement;

        root?.Q("done")?.RegisterCallback <ClickEvent>(ev => MakeTheThing());

        root?.Q("screen")?.RegisterCallback <PointerDownEvent>(ev => DownOverScreen());

        root?.Q("screen")?.RegisterCallback <PointerUpEvent>(ev => UpOverScreen());
    }
    // Update is called once per frame
    void Update()
    {
        if (placeOnPlane == null)
        {
            placeOnPlane = GameObject.Find("AR Session Origin").GetComponent <PlaceOnPlane>();
        }
        else if (!addedToPOP)
        {
            placeOnPlane.AddModel(gameObject);
            addedToPOP = true;
        }

        // Update visibility
        foreach (MeshRenderer renderer in GetComponentsInChildren <MeshRenderer>())
        {
            renderer.enabled = isVisible;
        }
    }
Esempio n. 5
0
    public void setCompany(string company)
    {
        GameObject   echo      = GameObject.Find("echoAR(Clone)");
        GameObject   arsession = GameObject.Find("AR Session Origin");
        PlaceOnPlane script    = arsession.GetComponent <PlaceOnPlane>();

        if (script.m_Anchors.Count > 0)
        {
            if (echo)
            {
                Destroy(echo);
            }

            echo = Instantiate(echoPreFab, script.m_Anchors[0].transform.position, Quaternion.identity);

            echo.GetComponent <echoAR>().company = company;
            echo.GetComponent <echoAR>().Init();
        }
    }
 void Awake()
 {
     m_placeOnPlane = GetComponent <PlaceOnPlane>();
 }
 private void Awake()
 {
     placeOnPlane     = GameObject.Find("AR Session Origin").GetComponent <PlaceOnPlane>();
     objectsToCollect = GameObject.Find("AR Session Origin").GetComponent <ObjectsToCollect>();
 }