public ActorModel JustCreateUIModel(int uid, int modelId, AvatarModel dataAM, bool model_active, string model_layer, Vector2 offsetlocalPos) { ActorModel actorModel = ModelPool.Instance.Get(modelId); if (actorModel == null) { return(null); } this.m_models.set_Item(uid, actorModel); actorModel.ModelType = ActorModelType.UI; actorModel.ModelLayer = model_layer; NavMeshAgent component = actorModel.GetComponent <NavMeshAgent>(); if (component != null) { component.set_enabled(false); } ModelDisplayManager.RefreshInitLocalPosition(actorModel, offsetlocalPos); actorModel.get_transform().set_localEulerAngles(new Vector3(0f, dataAM.modelProjRotateRevise, 0f)); actorModel.get_transform().set_localScale(Vector3.get_one() * dataAM.scale); actorModel.ShowShadow(false, modelId); actorModel.ChangeToIdle(); actorModel.get_gameObject().SetActive(model_active); return(actorModel); }
private static void CameraSettingOfActorModel(Camera cameraRT, AvatarModel dataAM, float modelOffset) { if (dataAM.camProjRotRevise.get_Count() >= 2) { ModelDisplayManager.CameraSettingOfActorModel(cameraRT, new Vector3(0f, dataAM.camProjRotRevise.get_Item(0), dataAM.camProjRotRevise.get_Item(1)), dataAM.camProjPosRevise, modelOffset); } }
public void SetModelWithAction(int modelId, string actionName, Action actionEnd = null) { this.m_modelId = modelId; if (this.m_actorModel == null) { this.m_actorModel = this.GetAM(); } ModelDisplayManager.ShowAction(this.m_actorModel, actionName, actionEnd); }
public static void CameraSettingOfActorModel(Camera cameraRT, Vector3 camProjRotateRevise, float aimTargetOffsetY, float modelOffset) { Quaternion identity = Quaternion.get_identity(); Vector3 vector = identity * camProjRotateRevise; Vector3 vector2 = vector + ModelDisplayManager.GetModelPosition(modelOffset); Vector3 modelPosition = ModelDisplayManager.GetModelPosition(modelOffset); modelPosition.y += aimTargetOffsetY; cameraRT.get_transform().set_position(new Vector3(ModelDisplayManager.GetModelPosition(modelOffset).x, vector2.y, vector2.z)); cameraRT.get_transform().LookAt(modelPosition); }
public void SetModelWithSkill(int modelId, int skillId, Action actionEnd) { this.m_modelId = modelId; if (this.m_actorModel == null) { this.m_actorModel = this.GetAM(); } if (skillId > 0) { ModelDisplayManager.ShowSkill(this.m_actorModel, skillId, actionEnd); } }
public static void ShowSkill(int model_uid, int skillId, Action skillEnd = null) { ActorModel uIModel = ModelDisplayManager.Instance.GetUIModel(model_uid); if (uIModel != null) { ModelDisplayManager.ShowSkill(uIModel, skillId, skillEnd); } else if (skillEnd != null) { skillEnd.Invoke(); } }
public override void OnCheckCombo(CheckComboCmd cmd) { int num = (!ModelDisplayManager.IsAlwaysCombo || !DataReader <Skill> .Contains(this.GetCurrentSkill())) ? 0 : DataReader <Skill> .Get(this.GetCurrentSkill()).combo; if (num != 0) { ModelDisplayManager.ShowSkill(this, num, delegate { CurrenciesUIViewModel.Show(true); PetBasicUIView.Instance.SetRawImageModelLayer(false, true, false); }); } }
private void PlayPetSKill(int SkillId) { EventDispatcher.Broadcast("UIManagerControl.HideTipsUI"); if (SkillId <= 0) { return; } CurrenciesUIViewModel.Show(false); PetBasicUIView.Instance.SetRawImageModelLayer(true, true, false); ModelDisplayManager.ShowSkill(PetBasicUIViewModel.PetModelUID, SkillId, delegate { CurrenciesUIViewModel.Show(true); PetBasicUIView.Instance.SetRawImageModelLayer(false, true, false); }); }
public static ActorModel SetRawImage(RawImage rawImage, int modelId, Vector2 offsetlocalPos, ref GameObject goModel, ref GameObject goCamera) { AvatarModel avatarModel = DataReader <AvatarModel> .Get(modelId); if (avatarModel == null) { return(null); } RenderTexture renderTexture = null; RTManager.CreateRenderTexture(ref renderTexture, "temp_render_texture"); rawImage.GetComponent <RectTransform>().set_sizeDelta(new Vector2((float)renderTexture.get_width(), (float)renderTexture.get_height())); RTManager.SetRT(rawImage, renderTexture); ActorModel actorModel = ModelDisplayManager.Instance.JustCreateUIModel(0, modelId, avatarModel, true, "CameraRange", offsetlocalPos); Camera camera = ModelDisplayManager.CreateCameraToModel(renderTexture); ModelDisplayManager.CameraSettingOfActorModel(camera, avatarModel, offsetlocalPos.x); goModel = actorModel.get_gameObject(); goCamera = camera.get_gameObject(); return(actorModel); }
public ActorModel CurrentPetModelSetting(int uid, AvatarModel dataAM, ActorModel actorModel) { ModelDisplayManager.CurrentActorPetModelUID = uid; ModelDisplayManager.SetRTManager(dataAM, actorModel); return(actorModel); }
public void SetCameraPosition(RTManager.RtType type, bool bEnable) { if (CamerasMgr.Camera2RTCommon == null) { Debug.LogError("CamerasMgr.Camera2RTCommon == null***********************"); return; } if (!bEnable) { return; } switch (type) { case RTManager.RtType.LocalHeatDistortion: CamerasMgr.Camera2RTCommon.get_transform().set_localPosition(Vector3.get_zero()); CamerasMgr.Camera2RTCommon.get_transform().set_localScale(Vector3.get_one()); CamerasMgr.Camera2RTCommon.get_transform().set_localRotation(Quaternion.get_identity()); break; case RTManager.RtType.Player: { if (this.AimTarget == null) { Debug.LogError("AimTarget is null"); return; } Quaternion rotation = this.AimTarget.get_rotation(); this.playerTmpPosition = this.AimTarget.get_position(); Vector3 vector = rotation * RTManager.Instance.CamProjRotateRevise; Vector3 position = vector + RTManager.Instance.AimTarget.get_transform().get_position(); Vector3 position2 = this.AimTarget.get_transform().get_position(); position2.y += this.AimTargetOffsetY; CamerasMgr.Camera2RTCommon.get_transform().set_position(position); CamerasMgr.Camera2RTCommon.get_transform().LookAt(position2); break; } case RTManager.RtType.ActorModel1: if (this.AimTarget != null) { ModelDisplayManager.CameraSettingOfActorModel(CamerasMgr.Camera2RTCommon, this.CamProjRotateRevise, this.AimTargetOffsetY, 0f); } break; case RTManager.RtType.InstanceBall: if (this.AimTarget != null && ModelDisplayManager.Instance.goTerrestrialGlobe != null) { Vector3 position3 = ModelDisplayManager.Instance.goTerrestrialGlobe.get_transform().FindChild("CameraLookAtPlace").get_position(); Vector3 position4 = ModelDisplayManager.Instance.goTerrestrialGlobe.get_transform().FindChild("CameraPlace").get_position(); CamerasMgr.Camera2RTCommon.get_transform().set_position(position4); CamerasMgr.Camera2RTCommon.get_transform().LookAt(position3); } break; case RTManager.RtType.ElementBall: if (this.AimTarget != null && ModelDisplayManager.Instance.elementBall != null) { Vector3 position5 = ModelDisplayManager.Instance.elementBall.get_transform().FindChild("CameraLookAtPlace").get_position(); Vector3 position6 = ModelDisplayManager.Instance.elementBall.get_transform().FindChild("CameraPlace").get_position(); CamerasMgr.Camera2RTCommon.get_transform().set_position(position6); CamerasMgr.Camera2RTCommon.get_transform().LookAt(position5); if (BallElement.Instance.distanceVisable == 0f) { BallElement.Instance.CalDistance(); } } break; } }
private void SetCameraRenderType(RTManager.RtType type, bool typeOn) { this.ResetRotation(); switch (type) { case RTManager.RtType.LocalHeatDistortion: { string[] array = new string[] { "FX_Distortion" }; int mask = LayerMask.GetMask(array); this.SetCameraCullingMask(type, typeOn, mask); break; } case RTManager.RtType.Player: { if (EntityWorld.Instance.ActSelf != null) { ShadowController.ShowShadow(EntityWorld.Instance.EntSelf.ID, EntityWorld.Instance.ActSelf, typeOn, 0); } string[] layerNames = new string[] { "CameraRange" }; int mask2 = LayerSystem.GetMask(layerNames); this.SetCameraCullingMask(type, typeOn, mask2); if (typeOn) { this.AimTargetOffsetY = ModelDisplayManager.GetPlayerAM().camProjPosRevise; if (ModelDisplayManager.GetPlayerAM().camProjRotRevise.get_Count() >= 2) { RTManager.Instance.CamProjRotateRevise = new Vector3(0f, ModelDisplayManager.GetPlayerAM().camProjRotRevise.get_Item(0), ModelDisplayManager.GetPlayerAM().camProjRotRevise.get_Item(1)); } } break; } case RTManager.RtType.ActorModel1: this.SetCameraCullingMask(type, typeOn, ModelDisplayManager.ModelFXMask); if (!typeOn) { this.HideModel(); CamerasMgr.SetRTCClippingPlanes(0f); } else { CamerasMgr.SetRTCClippingPlanes(100000f); } break; case RTManager.RtType.InstanceBall: { string[] layerNames2 = new string[] { "BallItem", "BallObject" }; int mask3 = LayerSystem.GetMask(layerNames2); this.SetCameraCullingMask(type, typeOn, mask3); if (!typeOn) { this.HideModel(); } break; } case RTManager.RtType.ElementBall: { string[] layerNames3 = new string[] { "BallItem", "BallObject" }; int mask4 = LayerSystem.GetMask(layerNames3); this.SetCameraCullingMask(type, typeOn, mask4); if (!typeOn) { this.HideModel(); } break; } } }
private void SetModel(int modelId) { this.mModelId = modelId; ModelDisplayManager.SetRawImage(this.mRawGodWeapon, modelId, new Vector2(1000f, ModelDisplayManager.OFFSET_TO_PETUI.y), ref this.mGoModel, ref this.mGoCamera); }
public void SetModel(int modelId) { this.m_modelId = modelId; ModelDisplayManager.SetRawImage(this.m_texPreviewModel, modelId, new Vector2((float)(1000 * this.m_index), ModelDisplayManager.OFFSET_TO_PETUI.y), ref this.m_goModel, ref this.m_goCamera); }
private ActorModel GetAM() { return(ModelDisplayManager.SetRawImage(this.m_texPreviewModel, this.m_modelId, new Vector2((float)(1000 * this.m_index), ModelDisplayManager.OFFSET_TO_PETUI.y), ref this.m_goModel, ref this.m_goCamera)); }