Exemplo n.º 1
0
        public void OtherTranslate(CloudTransformInfo info)
        {
            if (!IsMine)
            {
                return;
            }

            var translateInfo =
                new CloudTransformInfo(AnchorPositionUtility.GetWorldPointFromAnchorPoint(CloudAnchorManager.Instance.AnchorModel.CurrentAnchor, info.Position),
                                       AnchorPositionUtility.GetWorldPointFromAnchorPoint(CloudAnchorManager.Instance.AnchorModel.CurrentAnchor, info.Forward));

            _photonView.RPC(RPCDefine.ObjectRPC.GetRPCMethod(RPCDefine.ObjectRPC.RPCEnum.Translate), PhotonTargets.Others, translateInfo);
        }
Exemplo n.º 2
0
        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);
            };
        }