/// <summary> /// 非经过我同意禁用本接口 by吴江 /// </summary> /// <param name="_info"></param> /// <param name="_callBack"></param> /// <returns></returns> public bool TryPreviewSingelEntourage(MercenaryInfo _info, System.Action <PreviewEntourage> _callBack) { if (_info != null) { PreviewEntourage pp = PreviewEntourage.CreateDummy(_info); pp.mutualExclusion = false; pp.StartAsyncCreate(_callBack); return(true); } return(false); }
public bool TryPreviewSingelEntourage(MercenaryInfo _info, UITexture _showLabel) { curShowLabel = _showLabel; CancelAllDownLoad(); if (_info != null) { PreviewEntourage pp = PreviewEntourage.CreateDummy(_info); pp.StartAsyncCreate(CreateEntourageCallBack); return(true); } return(false); }
IEnumerator CreateAsync(System.Action <PreviewEntourage> _callback = null) { if (isDummy_ == false) { GameSys.LogError("You can only start create other player in dummy: " + actorInfo.ServerInstanceID); yield break; } // isDownloading_ = true; //判断是否正在下载,防止重复创建 PreviewEntourage opc = null; SmartActorRendererCtrl myRendererCtrl = null; bool faild = false; pendingDownload = Create(actorInfo, delegate(PreviewEntourage _opc, EResult _result) { if (_result != EResult.Success) { faild = true; return; } opc = _opc; pendingDownload = null; myRendererCtrl = opc.gameObject.GetComponentInChildrenFast <SmartActorRendererCtrl>(); myRendererCtrl.Show(false); }); if (mutualExclusion) { GameCenter.previewManager.PushDownLoadTask(pendingDownload); } while (opc == null || opc.inited == false) { if (faild) { yield break; } yield return(null); } if (mutualExclusion) { GameCenter.previewManager.EndDownLoadTask(pendingDownload); } pendingDownload = null; isDownloading_ = false; if (_callback != null) { _callback(opc); } }
public bool TryPreviewSingelEntourage(int _configID, UITexture _showLabel) { curShowLabel = _showLabel; CancelAllDownLoad(); NewPetRef refData = ConfigMng.Instance.GetNewPetRef(_configID); MercenaryInfo info = new MercenaryInfo(refData); if (info != null) { PreviewEntourage pp = PreviewEntourage.CreateDummy(info); pp.StartAsyncCreate(CreateEntourageCallBack); return(true); } return(false); }
/// <summary> /// 创建净数据对象 /// </summary> /// <param name="_id"></param> /// <returns></returns> public static PreviewEntourage CreateDummy(MercenaryInfo _info) { GameObject newGO = null; if (GameCenter.instance.dummyOpcPrefab != null) { newGO = Instantiate(GameCenter.instance.dummyOpcPrefab) as GameObject; newGO.name = "Dummy OPE [" + _info.ServerInstanceID + "]"; } else { newGO = new GameObject("Dummy OPE[" + _info.ServerInstanceID + "]"); } newGO.tag = "Entourage"; newGO.SetMaskLayer(LayerMask.NameToLayer("Preview")); PreviewEntourage newOPC = newGO.AddComponent <PreviewEntourage>(); newOPC.isDummy_ = true; newOPC.id = _info.ServerInstanceID; newOPC.actorInfo = _info; newOPC.transform.localRotation = new Quaternion(0, _info.RotationY, 0, 0); return(newOPC); }
public void CreateEntourageCallBack(PreviewEntourage _ent) { // previewCamera.fieldOfView = 60.0f; //防止有之前延迟的模型加载,再次清理 ClearModel(); previewEntourage = _ent; GameObject parent = GetModelTransform(_ent.PreviewPosition, _ent.PreviewRotation); if (null != parent) { _ent.transform.parent = parent.transform; _ent.transform.localPosition = new Vector3(0, -_ent.Height / 2f, 0); _ent.transform.localEulerAngles = new Vector3(0, 180f, 0); } _ent.FaceToNoLerp(180f); UIDragObjectRotate3D _UIDragObjectRotate3D = curShowLabel.gameObject.GetComponent <UIDragObjectRotate3D>(); if (_UIDragObjectRotate3D == null) { _UIDragObjectRotate3D = curShowLabel.gameObject.AddComponent <UIDragObjectRotate3D>(); } _UIDragObjectRotate3D.target = _ent; BindRenderAndUI(curShowLabel); }