/// <summary> /// 开启 /// </summary> /// <param name="enable"></param> public void Enable(bool enable) { if (ready) { renderObj.Enable(enable); } }
//void OnDisable() //{ // if (rtObj != null) // { // rtObj.Enable(false); // rtObj.Release(); // } //} protected override void OnDisable() { base.OnDisable(); if (rtObj != null) { rtObj.Enable(false); rtObj.Release(); rtObj = null; } }
private void EnablePlayerView(bool enable) { if (null != m_RTObj) { m_RTObj.Enable(enable); } if (null != m_petRTObj) { m_petRTObj.Enable(enable); } if (enable) { SetPlayerFightPower(); } }
void ShowPetRenderTex(bool bShow) { if (m_petRTObj == null) { // Engine.Utility.Log.Error("pet rt obj is null"); return; } if (m_petRTObj != null) { m_petRTObj.Enable(bShow); if (!bShow) { return; } } if (null != m__modelTexture) { UIRenderTexture rt = m__modelTexture.GetComponent <UIRenderTexture>(); if (null == rt) { rt = m__modelTexture.gameObject.AddComponent <UIRenderTexture>(); } if (null != rt) { rt.SetDepth(0); rt.Initialize(m_petRTObj, m_petRTObj.YAngle, new Vector2(750, 750), () => { DataManager.Manager <UIPanelManager>().HidePanel(PanelID.FashionTips); }); } SetRenderTexPos(m_petRTObj); } else { m_petRTObj.Release(); m_petRTObj = null; } }