public void PlaceObjectInMidAir(Transform midAirTransform) { if (planeMode != PlaneMode.MIDAIR) { Debug.Log("Invalid Ground Plane Mode:" + planeMode); return; } Debug.Log("PlaceObjectInMidAir() called."); if (positionalDeviceTracker != null && positionalDeviceTracker.IsActive) { DestroyAnchors(); contentPositioningBehaviour = m_MidAirPositioner.GetComponent <ContentPositioningBehaviour>(); contentPositioningBehaviour.PositionContentAtMidAirAnchor(midAirTransform); if (!m_MidAirAugmentation.activeInHierarchy) { Debug.Log("Setting Mid-Air Augmentation to Active"); // On initial run, unhide the augmentation m_MidAirAugmentation.SetActive(true); } Debug.Log("Positioning Mid-Air Augmentation at: " + midAirTransform.position.ToString()); m_MidAirAugmentation.PositionAt(midAirTransform.position); RotateTowardCamera(m_MidAirAugmentation); } }
public void PlaceObjectInMidAir(Transform midAirTransform) { if (planeMode == PlaneMode.MIDAIR) { Debug.Log("PlaceObjectInMidAir() called."); m_ContentPositioningBehaviour.AnchorStage = m_MidAirAnchor; m_ContentPositioningBehaviour.PositionContentAtMidAirAnchor(midAirTransform); UtilityHelper.EnableRendererColliderCanvas(m_MidAirAugmentation, true); m_MidAirAugmentation.transform.localPosition = Vector3.zero; UtilityHelper.RotateTowardCamera(m_MidAirAugmentation); } }
public void PlaceObjectInMidAir(Transform midAirTransform) { if (showGameObject != null && showGameObject.GetComponent <WriteItem>().goodsPositionEnum == PlaneMode.MIDAIR) { Debug.Log("PlaceObjectInMidAir() called."); m_ContentPositioningBehaviour.AnchorStage = m_MidAirAnchor; m_ContentPositioningBehaviour.PositionContentAtMidAirAnchor(midAirTransform); UtilityHelper.EnableRendererColliderCanvas(showGameObject, true); showGameObject.transform.parent = planeAnchor.transform; showGameObject.transform.localPosition = Vector3.zero; UtilityHelper.RotateTowardCameraVuforia(showGameObject); ShowInput(); } }
public void PlaceObjectInMidAir(Transform midAirTransform) { Debug.Log("PlaceObjectInMidAir() called."); m_ContentPositioningBehaviour.AnchorStage = m_MidAirAnchor; Debug.Log("1. m_ContentPositioningBehaviour.AnchorStage OR m_MidAirArchor is not null -> proceed"); m_ContentPositioningBehaviour.PositionContentAtMidAirAnchor(midAirTransform); Debug.Log("2. m_ContentPositioningBehaviour.PositionContentAtMidAirAnchor(midAirTransform) -> proceed"); UtilityHelper.EnableRendererColliderCanvas(m_MidAirAugmentation, true); Debug.Log("3. UtilityHelper.EnableRendererColliderCanvas(m_MidAirAugmentation, true); -> proceed"); m_MidAirAugmentation.transform.localPosition = Vector3.zero; Debug.Log("4. m_MidAirAugmentation.transform.localPosition = Vector3.zero; -> proceed"); UtilityHelper.RotateTowardCamera(m_MidAirAugmentation); Debug.Log("5. UtilityHelper.RotateTowardCamera(m_MidAirAugmentation); -> out"); }
public virtual void HandleInteractiveHitTest(HitTestResult result) { if (result == null) { Debug.LogError("Invalid hit test result!"); return; } if (!m_GroundPlaneUI.IsCanvasButtonPressed()) { Debug.Log("HandleInteractiveHitTest() called."); // If the PlaneFinderBehaviour's Mode is Automatic, then the Interactive HitTestResult will be centered. // PlaneMode.Ground and PlaneMode.Placement both use PlaneFinder's ContentPositioningBehaviour m_ContentPositioningBehaviour = m_PlaneFinder.GetComponent <ContentPositioningBehaviour>(); m_ContentPositioningBehaviour.DuplicateStage = false; // Place object based on Ground Plane mode if (showGameObject != null && lastName != showGameObjectName) { lastName = showGameObjectName; showGameObject.gameObject.SetActive(true); isPlaced = true; if (showGameObjectName == "haiou") { showGameObject.GetComponent <Haiou>().Init(); } else { FingerTouchEL.Instance.targetGameObject = showGameObject; } UtilityHelper.EnableRendererColliderCanvas(showGameObject, true); switch (showGameObject.GetComponent <WriteItem>().goodsPositionEnum) { case PlaneMode.None: break; case PlaneMode.GROUND: m_ContentPositioningBehaviour.AnchorStage = m_PlaneAnchor; m_ContentPositioningBehaviour.PositionContentAtPlaneAnchor(result); showGameObject.transform.parent = planeAnchor.transform; break; case PlaneMode.MIDAIR: m_ContentPositioningBehaviour.AnchorStage = m_MidAirAnchor; m_ContentPositioningBehaviour.PositionContentAtMidAirAnchor(showGameObject.transform); showGameObject.transform.parent = midAirAnchor.transform; break; default: break; } showGameObject.transform.localPosition = Vector3.zero; showGameObject.transform.localEulerAngles = Vector3.zero; if (showGameObject.name == "wurenji") { showGameObject.GetComponentInChildren <Cloth>().enabled = false; } showGameObject.transform.localScale = Vector3.one * 0.5f; if (showGameObject.name == "wurenji") { showGameObject.GetComponentInChildren <Cloth>().enabled = true; } UtilityHelper.RotateTowardCameraVuforia(showGameObject); // YiyouStaticDataManager.Instance.ShowModel = showGameObject; FirstUseTipManager.Instance.ShowNextTip(TipType.WriteTip); WriteItem writeItem = showGameObject.GetComponent <WriteItem>(); if (writeItem != null && writeItem.goodsEnum != GoodsWriteEnum.None) { ShowInput(); GroundPlaneUI.Instance.SetIntroductionText("请选择字体并输入文字"); } else { GroundPlaneUI.Instance.SetIntroductionText("", false); ShowButtonPanel(); } ShowEffectPanel(); GroundPlaneUI.Instance.SetReticleVisiblity(false); WriteManager.Instance.SetGoodsEnum(showGameObject.GetComponent <WriteItem>().goodsEnum); InitLight(showGameObject.name); } else { if (showGameObject == null) { GroundPlaneUI.Instance.SetIntroductionText("请先选择合影道具"); } } } }