public override void OnARPlaneHit(PortalbleHitResult hit) { base.OnARPlaneHit(hit); if (placePrefab != null) { Transform cen = Instantiate(placePrefab, hit.Pose.position + hit.Pose.rotation * Vector3.up * offset, hit.Pose.rotation); cen.gameObject.GetComponent <Renderer>().material.color = FocusUtils.ObjNormalColor; m_sDM.SceneObjects.Add(cen.gameObject); List <Transform> cens = new List <Transform>(); // for focus center test purposes int num = 3; // change this number to change number of prefabs float offset_test = placePrefab.transform.localScale[0] * 1.2f; for (int i = -num; i < num + 1; i++) { for (int j = -num; j < num + 1; j++) { if (i == 0 && j == 0) { continue; } Transform obj = Instantiate(placePrefab, cen.position + i * offset_test * cen.right - j * offset_test * cen.forward, cen.rotation); obj.gameObject.GetComponent <Renderer>().material.color = FocusUtils.ObjNormalColor; cens.Add(obj); m_sDM.SceneObjects.Add(obj.gameObject); } } int idx = Random.Range(0, cens.Count); cens[idx].gameObject.GetComponent <Selectable>().SetAsTarget(); } }
public override void OnARPlaneHit(PortalbleHitResult hit) { base.OnARPlaneHit(hit); if (placePrefab != null) { Instantiate(placePrefab, hit.Pose.position + hit.Pose.rotation * Vector3.up * offset, hit.Pose.rotation); } }
public override void OnARPlaneHit(PortalbleHitResult hit) { base.OnARPlaneHit(hit); //if (placePrefab != null) //{ // Instantiate(m_createMenu.transform, hit.Pose.position + hit.Pose.rotation * Vector3.up * offset, hit.Pose.rotation); // Debug.Log("FOAMFILTER hit pos" + hit.Pose.position + hit.Pose.rotation * Vector3.up * offset); // Debug.Log("FOAMFILTER hit rotation" + hit.Pose.rotation); //} }
public override void OnARPlaneHit(PortalbleHitResult hit) { base.OnARPlaneHit(hit); Transform poop = null; if (placePrefab != null) { poop = Instantiate(placePrefab, hit.Pose.position + hit.Pose.rotation * Vector3.up * offset, hit.Pose.rotation); } Vector3 targetPostition = new Vector3(-Camera.main.transform.position.x, poop.position.y, -Camera.main.transform.position.z); poop.transform.LookAt(targetPostition); }
public override void OnARPlaneHit(PortalbleHitResult hit) { if (mode == 0) { return; } base.OnARPlaneHit(hit); if (_burstPoses.Count > 2) { _burstPoses.Dequeue(); } _burstPoses.Enqueue(hit.Pose.position); _isBursting = true; }