public TouchDetector(PlaneTouchHandler planeTouchHandler, VirtualObjectTouchHandler virtualObjectTouchHandler, ARRaycastManager arRaycastmanager, Logger logger) { this.planeTouchHandler = planeTouchHandler; this.virtualObjectTouchHandler = virtualObjectTouchHandler; this.arRaycastmanager = arRaycastmanager; this.logger = logger; this.lastTouch = null; this.lastTouchResolved = false; GenericState <TouchDetector> .InitState <SNoTouch>(this); }
void Awake() { arRaycastManager = GetComponent <ARRaycastManager>(); arReferencePointManager = GetComponent <ARAnchorManager>(); arPointCloudManager = GetComponent <ARPointCloudManager>(); toggleButton.onClick.AddListener(ToggleDetection); clearReferencePointsButton.onClick.AddListener(ClearReferencePoints); debugLog.gameObject.SetActive(false); }
void Start() { sessionOrigin = GetComponent <ARSessionOrigin>(); hits = new List <ARRaycastHit>(); raycastManager = FindObjectOfType <ARRaycastManager>(); isAlreadyPlaced = false; ARBase1.SetActive(false); ARBase2.SetActive(false); ARBase3.SetActive(false); ARBase4.SetActive(false); }
// Start is called before the first frame update void Start() { arOrigin = FindObjectOfType <ARSessionOrigin>(); arRaycastManager = FindObjectOfType <ARRaycastManager>(); arPlaneManager = FindObjectOfType <ARPlaneManager>(); selectionManager = FindObjectOfType <SelectionManager>(); clickToRemoveSound = FindObjectOfType <AudioSource>(); gameboardGenerator = FindObjectOfType <GameboardGenerator>(); objectToPlace.tag = "Selectable"; objectToPlace.transform.tag = "Selectable"; }
void Awake() { m_RaycastManager = GetComponent <ARRaycastManager>(); if (Application.isEditor) { for (int i = 0; i < TestingGround.Length; i++) { TestingGround[i].SetActive(true); } } }
private void Awake() { RaycastManager = GetComponent <ARRaycastManager>(); PlaneManager = GetComponent <ARPlaneManager>(); SessionOrigin = GetComponent <ARSessionOrigin>(); //PointCloudManager = GetComponent<ARPointCloudManager>(); SetVRPositionButton.gameObject.SetActive(false); TransferOwnershipButton.gameObject.SetActive(false); MazeManager.SetActive(false); }
// Start is called before the first frame update void Start() { aRRaycastManager = FindObjectOfType <ARRaycastManager>(); aRAnchorManager = FindObjectOfType <ARAnchorManager>(); indicator = Instantiate(placementIndicator); aRAnchors = new List <ARAnchor>(); isPlacementValid = false; tryingToUpdate = false; inCreateAnchor = false; movingAnchor = false; selectMode = false; }
// Start is called before the first frame update void Start() { aRRaycastManager = GetComponent <ARRaycastManager>(); aRAnchorManager = GetComponent <ARAnchorManager>(); indicator = Instantiate(placementIndicator); currentCloudSpatialAnchor = null; aRAnchors = new List <ARAnchor>(); isPlacementValid = false; tryingToUpdate = false; inCreateAnchor = false; movingAnchor = false; }
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()); } }
void Awake() //初始化 { arRaycastManager = GetComponent <ARRaycastManager>(); startPoint = Instantiate(measurementPointPrefab, Vector3.zero, Quaternion.identity); endPoint = Instantiate(measurementPointPrefab, Vector3.zero, Quaternion.identity); measureLine = GetComponent <LineRenderer>(); startPoint.SetActive(false); endPoint.SetActive(false); }
void Start() { aRRaycastManager = FindObjectOfType <ARRaycastManager>(); mArPlaneManager.planesChanged += onPlanesChanged; mArPointCloudManager.pointCloudsChanged += onPointCloudsChanged; ARSession.stateChanged += Change; aRCameraManager.frameReceived += onCameraFrameChanged; }
void Start() { this.arRaycastManager = GetComponent <ARRaycastManager>(); this.objectDetector = goObjectDetector.GetComponent <TinyYolo3Detector>(); this.objectDetector.Start(); this.similarWordClient = goSimilarWordClient.GetComponent <SimilarWordClient>(); this.similarWordClient.Start(); CalculateShift(); }
void Awake() { arRaycastManager = GetComponent <ARRaycastManager>(); // set initial prefab ChangePrefabTo("cube"); greenButton.onClick.AddListener(() => ChangePrefabTo("sphere")); blueButton.onClick.AddListener(() => ChangePrefabTo("cube")); redButton.onClick.AddListener(() => ChangePrefabTo("capsule")); dismissButton.onClick.AddListener(Dismiss); selectSreenButton.onClick.AddListener(OpenSelect); }
void Awake() { arRaycastManager = GetComponent <ARRaycastManager>(); dismissButton.onClick.AddListener(Dismiss); if (redButton != null && greenButton != null && blueButton != null) { redButton.onClick.AddListener(() => ChangePrefabSelection("ARRed")); greenButton.onClick.AddListener(() => ChangePrefabSelection("ARGreen")); blueButton.onClick.AddListener(() => ChangePrefabSelection("ARBlue")); } }
public virtual void awakeInternal() { m_lineVisualizer = Instantiate(DistanceVisualizerPrefab, Vector3.zero, Quaternion.identity); raycastManager = ARSessionOrigin.GetComponent <ARRaycastManager>(); m_lineRenderer = m_lineVisualizer.GetComponent <LineRenderer>(); m_lineRenderer.startWidth = 0.02f; m_lineRenderer.endWidth = 0.02f; m_lineRenderer.positionCount = 0; m_lineRenderer.sortingOrder = 1; m_lineRenderer.material = new Material(Shader.Find("Sprites/Default")); m_lineRenderer.material.color = Color.blue; }
private void Initialize() { arRaycastmanager = GetComponent <ARRaycastManager>(); virtualObjectsManager = new VirtualObjectsManager(gameObjectToInstantiate, logger); materialManager = new MaterialManager(gameObjectToInstantiate); uiControls = new UIControls(); controller = new MasterController(virtualObjectsManager, materialManager, uiControls); uiControls.SetController(controller); planeTouchHandler = new PlaneTouchHandler(virtualObjectsManager, controller); virtualObjectTouchHandler = new VirtualObjectTouchHandler(virtualObjectsManager, controller); touchDetector = new TouchDetector(planeTouchHandler, virtualObjectTouchHandler, arRaycastmanager, logger); }
void Awake() { arRaycastManager = GetComponent <ARRaycastManager>(); // set initial prefab ChangePrefabTo("ARBlue"); arGreenButton.onClick.AddListener(() => ChangePrefabTo("ARGreen")); arBlueButton.onClick.AddListener(() => ChangePrefabTo("ARBlue")); arRedButton.onClick.AddListener(() => ChangePrefabTo("ARRed")); dismissButton.onClick.AddListener(Dismiss); }
void Start() { sessionOrigin = GetComponent <ARSessionOrigin>(); castManager = GetComponent <ARRaycastManager>(); hits = new List <ARRaycastHit>(); objectSpawned = false; buttonClicked = false; model.SetActive(false); canvas.SetActive(false); }
bool is_pc; // prototype by running on pc when possible (no ar) void Awake() { m_RaycastManager = GetComponent <ARRaycastManager>(); this.camera = GameObject.Find("AR Camera"); Debug.Log("Initial camera position: " + this.camera.transform.position.ToString()); this.drinkText = GameObject.Find("DrinkText"); Debug.Log("Have drink text: " + this.drinkText.ToString()); this.drinkText.SetActive(false); this.is_pc = true; }
void Start() { sessionOrigin = GetComponent <ARSessionOrigin>(); //Using FindObjectOfType find ARsessionOrigin //sessionOrigin = GetComponent<ARRaycastManager>(); //generate the list everytime running this file hits = new List <ARRaycastHit>(); raycastManager = FindObjectOfType <ARRaycastManager>();//not recommend if use for several time graffiti1IsAlreadyPlaced = false; graffiti2IsAlreadyPlaced = false; graffiti3IsAlreadyPlaced = false; graffiti4IsAlreadyPlaced = false; }
private void BuildMode(ARPlaneManager planeManager, ARRaycastManager raycastManager, PlaceItem placeItem, ARTrackedImageManager imageManager) { Scan_toggle_btn.gameObject.SetActive(false); imageManager.enabled = false; Build_toggle_btn.gameObject.SetActive(true); Library_btn.gameObject.SetActive(true); Scale_btn.gameObject.SetActive(true); Rotate_btn.gameObject.SetActive(true); planeManager.enabled = true; raycastManager.enabled = true; placeItem.enabled = true; }
void Start() { sessionOrigin = GetComponent <ARSessionOrigin>(); raycastManager = GetComponent <ARRaycastManager>(); planeManager = GetComponent <ARPlaneManager>(); hits = new List <ARRaycastHit>(); audioSource.volume = 0.3f; foreach (ButtonState button in StateButtons) { button.OnButtonClick += StateHandler; } }
float speed; // 子猫の移動スピード // 起動時に1度呼び出される void Start() { // オブジェクトに追加されているARRaycastManagerコンポーネントを取得 raycastManager = GetComponent <ARRaycastManager>(); // プレイモード用床面が設定されていて、AR使用フラグがOFFの場合は床面を表示 if (floorPlane != null) { floorPlane.SetActive(!useAR); } // 関連付けられたCameraオブジェクトを使用するためARSessionOriginを取得する arSession = GetComponent <ARSessionOrigin>(); }
/// <summary> /// Start is called on the frame when a script is enabled just before any /// of the Update methods are called the first time. /// </summary> public virtual void Start() { #if UNITY_ANDROID || UNITY_IOS arRaycastManager = FindObjectOfType <ARRaycastManager>(); if (arRaycastManager == null) { Debug.Log("Missing ARRaycastManager in scene"); } #endif #if WINDOWS_UWP || UNITY_WSA UnityEngine.XR.WSA.Input.InteractionManager.InteractionSourcePressed += InteractionManager_InteractionSourcePressed; #endif }
private void OnEnable() { if (!arCamera) { arCamera = transform.GetChild(0).GetComponent <Camera>(); } if (!arRaycaster) { arRaycaster = GetComponent <ARRaycastManager>(); } Reset(); }
//private Collider2D button; private void Awake() { AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject activity = unityPlayer.GetStatic <AndroidJavaObject>("currentActivity"); activity.Call("runOnUiThread", new AndroidJavaRunnable(() => { activity.Call("onUnityModeEnded"); })); _arRaycastManager = GetComponent <ARRaycastManager>(); footIcon = FindInActiveObjectByName("FootUI"); isObjectSpawned = false; isFixed = false; //button = GameObject.Find("Button").GetComponent<Collider2D>(); }
void Awake() { arRaycastManager = GetComponent <ARRaycastManager>(); startPoint = Instantiate(measurementPointPrefab, Vector3.zero, Quaternion.identity); endPoint = Instantiate(measurementPointPrefab, Vector3.zero, Quaternion.identity); measureLine = GetComponent <LineRenderer>(); startPoint.SetActive(false); endPoint.SetActive(false); dismissButton.onClick.AddListener(Dismiss); }
private void Start() { arOrigin = FindObjectOfType <ARSessionOrigin>(); arRayManager = arOrigin.GetComponent <ARRaycastManager>(); if (deviceCam == null) { #if (UNITY_ANDROID && !UNITY_EDITOR) AndroidJavaClass cameraClass = new AndroidJavaClass("android.hardware.Camera"); deviceCam = cameraClass.CallStatic <AndroidJavaObject>("open"); FlashLight(); #endif } }
void Start() { LightSpawners = new List <GameObject>(); if (Application.isEditor) { currentGameMode = GameMode.Racing; return; } arOrigin = FindObjectOfType <ARSessionOrigin>(); raycastManager = FindObjectOfType <ARRaycastManager>(); currentGameMode = GameMode.Placement; }
private void Awake() { trackedImageManager = FindObjectOfType <ARTrackedImageManager>(); raycastManager = GetComponent <ARRaycastManager>(); foreach (GameObject prefab in transportPrefabs) { GameObject newPrefab = Instantiate(prefab, Vector3.zero, Quaternion.identity); newPrefab.SetActive(false); newPrefab.name = prefab.name; spawnedPrefabs.Add(prefab.name, newPrefab); } this.enabled = false; }