public override void OnCreate() { this.m_MsgListItemPool.Clear(); this.m_CurListItems.Clear(); MonsterHandbookData.AddMhEvent += this.AddMhByData; this.m_PeViewCtrl = SpeciesViewStudio.CreateViewController(ViewControllerParam.DefaultSpicies); this.m_UIViewCtrl.Init(this.m_PeViewCtrl); this.m_CameraTxuture.mainTexture = this.m_PeViewCtrl.RenderTex; this.m_ViewWndSize = new Vector2(this.m_CameraTxuture.mainTexture.width, this.m_CameraTxuture.mainTexture.height); // SpeciesViewStudio.Instance.gameObject.SetActive(false); }
private void AdjustOpDistance() { Bounds bounds = SpeciesViewStudio.GetModelBounds(gameObject); if (bounds.size == Vector3.zero) { base.operateDistance = 0f; } else { base.operateDistance = Mathf.Max(bounds.extents.x, bounds.extents.z) + 1.5f; } }
void LateUpdate() { if (this.m_OpCameraStep == 1) { Bounds bounds = SpeciesViewStudio.GetModelBounds(this.m_CurMonsterGo); this.UpdateSizeInfo(bounds); float distance, yaw; SpeciesViewStudio.GetCanViewModelFullDistance(this.m_CurMonsterGo, this.m_PeViewCtrl.viewCam, this.m_ViewWndSize, out distance, out yaw); this.m_UIViewCtrl.SetCameraToBastView(bounds.center, distance, yaw, this.m_CameraScaleFactor); this.PlayAnimator(); this.m_OpCameraStep = 2; } else if (this.m_OpCameraStep == 2) { this.m_PeViewCtrl.viewCam.enabled = true; this.m_OpCameraStep = 0; } }
private void SetNewModel(int modelID) { if (modelID == m_CurMonsterID) { return; } this.m_CurAnimator = null; this.m_MovementField = MovementField.None; DestoryCurModel(); this.m_PeViewCtrl.viewCam.enabled = false; this.m_CurMonsterGo = SpeciesViewStudio.LoadMonsterModelByID(modelID, ref m_MovementField); this.m_CurMonsterID = modelID; if (null == m_CurMonsterGo) { return; } this.m_CurAnimator = m_CurMonsterGo.GetComponent <Animator>(); this.m_PeViewCtrl.SetTarget(this.m_CurMonsterGo.transform); this.m_OpCameraStep = 1; }