Ejemplo n.º 1
0
    private void Awake()
    {
        _arPlacementManager        = GetComponent <ARPlacementManagerBolt>();
        _arDebugManager            = GetComponent <ARDebugManager>();
        _arCloudAnchorsMetaManger  = GetComponent <CloudAnchorsMetaManager>();
        _arPlaneManger             = GetComponent <ARPlaneManager>();
        _worldOriginBigWrapManager = GetComponent <WorldOriginBigWrapManager>();

        resolver = new UnityEvent <Transform, int>();
        resolver.AddListener((t, i) => _arPlacementManager.ReCreatePlacement(t, i));

        for (i = 0; i < NUM_OF_ANCHOR; i++)
        {
            pendingHostAnchorList.Add(null);
            anchorToResolveList.Add(null);
            cloudAnchorList.Add(null);
        }

        // FeatureMapQuality quality = _arAnchorManager.EstimateFeatureMapQualityForHosting(GetCameraPose());
        // if (quality != 0)
        // {
        //     _arCloudAnchorsMetaManger.SendJoin((int)quality);
        // } else
        // {
        //     _arCloudAnchorsMetaManger.SendJoin(0);
        // }
        // _arCloudAnchorsMetaManger.SendJoin(1);
    }
Ejemplo n.º 2
0
    void Awake()
    {
        _arRaycastManager     = GetComponent <ARRaycastManager>();
        _arAnchorManager      = GetComponent <ARAnchorManager>();
        _arCloudAnchorManager = GetComponent <ARCloudAnchorManager>();
        _arDebugManager       = GetComponent <ARDebugManager>();

        for (int i = 0; i < _arCloudAnchorManager.NUM_OF_ANCHOR; i++)
        {
            placedGameObjectList.Add(new GameObject());
        }
    }
Ejemplo n.º 3
0
    void Awake()
    {
        _arRaycastManager     = GetComponent <ARRaycastManager>();
        _arAnchorManager      = GetComponent <ARAnchorManager>();
        _arDebugManager       = GetComponent <ARDebugManager>();
        _arCloudAnchorManager = GetComponent <ARCloudAnchorManagerBolt>();

        // _arDebugManager.LogInfo($"NUM_OF_ANCHOR from editor = {_arCloudAnchorManager.NUM_OF_ANCHOR}");
        // _arDebugManager.LogInfo($"NUM_OF_ANCHOR from Awake = {GetComponent<ARCloudAnchorManagerBolt>().NUM_OF_ANCHOR}");

        for (int i = 0; i < _arCloudAnchorManager.NUM_OF_ANCHOR; i++)
        {
            placedGameObjectList.Add(new GameObject());
        }
    }
Ejemplo n.º 4
0
    private void Awake()
    {
        _arPlacementManager = GetComponent <ARPlacementManager>();
        _arDebugManager     = GetComponent <ARDebugManager>();

        resolver = new UnityEvent <Transform, int>();
        resolver.AddListener((t, i) => _arPlacementManager.ReCreatePlacement(t, i));

        for (i = 0; i < NUM_OF_ANCHOR; i++)
        {
            pendingHostAnchorList.Add(null);
            anchorToResolveList.Add(null);
            cloudAnchorList.Add(null);
        }
        worldOrigin = new GameObject();
    }
Ejemplo n.º 5
0
    void Awake()
    {
        _arRaycastManager     = GetComponent <ARRaycastManager>();
        _arAnchorManager      = GetComponent <ARAnchorManager>();
        _arPlaneManger        = GetComponent <ARPlaneManager>();
        _arCloudAnchorManager = GetComponent <ARCloudAnchorManager>();
        _arDebugManager       = GetComponent <ARDebugManager>();

        for (int i = 0; i < _arCloudAnchorManager.NUM_OF_ANCHOR; i++)
        {
            placedGameObjectList.Add(new GameObject());
        }

        halfHeight = Screen.height * 0.5f;
        halfWidth  = Screen.width * 0.5f;
        placementIndicator.SetActive(false);
    }
Ejemplo n.º 6
0
 private void Initialize()
 {
     grab         = ManoGestureContinuous.CLOSED_HAND_GESTURE;
     pinch        = ManoGestureContinuous.HOLD_GESTURE;
     openPinch    = ManoGestureContinuous.OPEN_PINCH_GESTURE;
     click        = ManoGestureTrigger.CLICK;
     grabTrigger  = ManoGestureTrigger.GRAB_GESTURE;
     cubeRenderer = GetComponent <Renderer>();
     cubeRenderer.sharedMaterial = arCubeMaterial[0];
     cubeRenderer.material       = arCubeMaterial[0];
     actionCoolDown  = 0;
     defaultParent   = transform.parent.gameObject;
     _arDebugManager = GameObject.Find("AR Session Origin").GetComponent <ARDebugManager>();
     // colliding = null;
     // FreeFall();
     // if (BoltNetwork.IsServer)
     // {
     //     _arDebugManager.LogInfo($"You are the server, you can move me");
     // }
 }
Ejemplo n.º 7
0
 private void Initialize()
 {
     grab         = ManoGestureContinuous.CLOSED_HAND_GESTURE;
     pinch        = ManoGestureContinuous.HOLD_GESTURE;
     openPinch    = ManoGestureContinuous.OPEN_PINCH_GESTURE;
     click        = ManoGestureTrigger.CLICK;
     grabTrigger  = ManoGestureTrigger.GRAB_GESTURE;
     cubeRenderer = GetComponent <Renderer>();
     cubeRenderer.sharedMaterial = arCubeMaterial[0];
     cubeRenderer.material       = arCubeMaterial[0];
     actionCoolDown  = 0;
     _arDebugManager = GameObject.Find("AR Session Origin").GetComponent <ARDebugManager>();
     // colliding = null;
     // FreeFall();
     if (entity.IsOwner)
     {
         gameObject.GetComponent <Rigidbody>().useGravity = true;
     }
     else
     {
         gameObject.GetComponent <Rigidbody>().useGravity = false;
     }
 }
Ejemplo n.º 8
0
 private void Start()
 {
     _arDebugManager = gameObject.GetComponent <ARDebugManager>();
 }