Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (_menu.activeSelf)
        {
            _skyColorImage.color = _lightingManager.GetSkyColor();
            _sunColorImage.color = _lightingManager.GetSunColor();

            Vector3 skyIrr = _lightingManager.GetSkyIrradiance();
            Vector3 sunIrr = _lightingManager.GetSunIrradiance();


            _skyIrrRText.text = skyIrr.x.ToString("00.00");
            _skyIrrGText.text = skyIrr.y.ToString("00.00");
            _skyIrrBText.text = skyIrr.z.ToString("00.00");
            _sunIrrRText.text = sunIrr.x.ToString("00.00");
            _sunIrrGText.text = sunIrr.y.ToString("00.00");
            _sunIrrBText.text = sunIrr.z.ToString("00.00");

            SunPos sunPos = _lightingManager.GetSunPos();
            _sunDirAz.text  = sunPos.az.ToString("000.0");
            _sunDirZen.text = sunPos.zen.ToString("000.0");

            _skyNbrLightsText.text = _lightingManager.GetNbrSkyDomeLights().ToString();


            _arKitLightEstText.text   = _arkitLightEstimation.GetARKitLightEstimationIntensity().ToString();
            _arKitLightEstImage.color = _arkitLightEstimation.GetARKitLightEstimationColor();
        }
    }
Beispiel #2
0
    bool HitTestWithResultType(ARPoint point, ARHitTestResultType resultTypes)
    {
        List <ARHitTestResult> hitResults = UnityARSessionNativeInterface.GetARSessionNativeInterface().HitTest(point, resultTypes);

        if (hitResults.Count > 0)
        {
            foreach (var hitResult in hitResults)
            {
                Debug.Log("Got hit!");



                Vector3    hitPos = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                Quaternion hitRot = UnityARMatrixOps.GetRotation(hitResult.worldTransform);

                switch (_type)
                {
                case ModelType.CubeWhitePlane:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_cubeWhitePlanePrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.CubeTransparentPlane:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_cubeTransparentPlanePrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Apple01:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_apple01Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Apple02:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_apple02Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Apple03:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_apple03Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Apple06:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_apple06Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Apple08:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_apple08Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Apple09:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_apple09Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Apple10:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_apple10Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Apple11:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_apple11Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Banana01:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_banana01Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Banana03:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_banana03Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Banana05:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_banana05Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Banana07:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_banana07Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Banana10:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_banana10Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Pear01:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_pear01Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Pear02:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_pear02Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Pear04:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_pear04Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick01:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick01Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick02:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick02Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick03:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick03Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick04:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick04Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick05:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick05Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick06:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick06Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick07:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick07Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick08:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick08Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick09:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick09Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick10:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick10Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick11:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick11Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Stick12:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_stick12Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock03:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock03Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock19:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock19Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock20:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock20Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock21:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock21Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock24:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock24Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock28:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock28Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock32:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock32Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock33:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock33Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock37:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock37Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock39:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock39Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock40:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock40Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock41:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock41Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock42:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock42Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock44:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock44Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.Rock46:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_rock46Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolAdjustableWrench:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolAdjustableWrenchPrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolClamp:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolClampPrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolHammer1:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolHammer1Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolHammer2:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolHammer2Prefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolHatchet:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolHatchetPrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolPliers:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolPliersPrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolPrybar:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolPrybarPrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolScrewdriver:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolScrewdriverPrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolSocketWrench:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolSocketWrenchPrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }

                case ModelType.ToolWrench:
                {
                    Destroy(_gameObject);
                    _gameObject = Instantiate(_toolWrenchPrefab);

                    _gameObject.transform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                    _gameObject.transform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                    _anchorID = _anchorManager.AddUserAnchor(_gameObject);
                    break;
                }
                }

                _lightingManager.SetSunDirection(_gameObject);
                _gameObject.GetComponent <SetMaterialProperties>().SetNbrLights(_lightingManager.GetNbrSkyDomeLights());
                _gameObject.GetComponent <SetMaterialProperties>().SetSkyVisibilityMultiplier(_lightingManager.GetSkyVisibilityMultiplier());
                _gameObject.GetComponent <SetMaterialProperties>().SetIrradiances(_lightingManager.GetSunIrradiance(), _lightingManager.GetSkyIrradiance());
                //_gameObject.GetComponent<SetMaterialProperties>().SetAlbedoMultiplier(1.0f);

                _isPlacingEnabled = false;
                return(true);
            }
        }
        return(false);
    }