public void RPCPetActivate(CloudTransformInfo info) { var anchorTransform = AnchorPositionUtility.GetAnchorTransform(CloudAnchorManager.Instance.CurrentAnchor, info); var pet = _activatorUseCase.ActivatePet(_petRoot, anchorTransform.Item1, anchorTransform.Item2); _petPresenter = pet; }
/// <summary> /// ペットを呼ぶ /// </summary> /// <param name="petRoot">ペットをぶらさげるRoot</param> /// <param name="info">ペットを呼んだ際の通知用info</param> public PetPresenter ActivatePet(Transform petRoot, Vector3 position, Vector3 forward) { var pet = PetPresenter.Create(petRoot); pet.SetPosition(position); pet.transform.LookAt(forward); _model.SetMode(UIMode.Breed); return(pet); }
private void SetEvent() { _breederUIView.AnchorSystemUIView.AnchorSettingButton.onClickedCallback += () => { if (!CloudAnchorManager.Instance.AnchorModel.IsTrackable.Value) { return; } if (CloudAnchorManager.Instance.AnchorModel.CloudMode == ApplicationMode.Hosting) { CloudAnchorManager.Instance.HostLastPlacedAnchor(); } else if (CloudAnchorManager.Instance.AnchorModel.CloudMode == ApplicationMode.Resolving) { CloudAnchorManager.Instance.ResolveAnchorFromId(RoomManager.Instance.AnchorId); } _model.SetMode(UIMode.Activate); }; _breederUIView.PetSystemUIView.PetActivationButton.onClickedCallback += () => { if (!CloudAnchorManager.Instance.AnchorModel.IsTrackable.Value) { return; } var pet = _activatorUseCase.ActivatePet(_petRoot, CloudAnchorManager.Instance.CurrentAnchor.position, Vector3.forward); _petPresenter = pet; Vector3 petWorldPosition = AnchorPositionUtility.GetWorldPointFromAnchorPoint(CloudAnchorManager.Instance.CurrentAnchor, pet.position); Vector3 petWorldForward = AnchorPositionUtility.GetWorldPointFromAnchorPoint(CloudAnchorManager.Instance.CurrentAnchor, pet.transform.forward); CloudTransformInfo petWorldTransformInfo = new CloudTransformInfo(petWorldPosition, petWorldForward); _photonView.RPC(RPCDefine.BreederRPC.GetRPCMethod(RPCDefine.BreederRPC.RPCEnum.PetActivate), PhotonTargets.Others, petWorldTransformInfo); }; }