protected void winAlpha1(int id) { Texture tex = NgMaterial.GetTexture(m_SelectedMaterial, true); if (tex != null) { Rect rect = FXMakerLayout.GetOffsetRect(new Rect(0, m_nPreviewCaptionHeight, m_nPreviewMaterialWidth - m_nPreviewCaptionHeight, m_nPreviewMaterialWidth - m_nPreviewCaptionHeight), -4); EditorGUI.DrawTextureAlpha(rect, tex); } }
protected void SetActiveObject(Texture selTexture, bool bMaskTex) { if (selTexture == null) { return; } // Create Mat if (m_SelectedMaterial == null || NgMaterial.GetTexture(m_SelectedMaterial, bMaskTex) != selTexture) { SetActiveMaterial(null, selTexture, false, bMaskTex); } // Find NewTexture Materials FindCurrentTextureMaterials(m_SelectedMaterial); // Create NewShader Materials CreateNewShaderMaterials(m_SelectedMaterial); m_SelectedTextureMaterials = m_CurrentTextureMaterials; }
public override void OnGUIPopup() { base.OnGUIPopup(); // Popup Window --------------------------------------------------------- // FXMakerMain.inst.PopupFocusWindow(NgLayout.GetWindowId(NgLayout.WINDOWID.POPUP), GetPopupRect(), winPopup, "Material"); FXMakerMain.inst.ModalMsgWindow(FXMakerLayout.GetWindowId(FXMakerLayout.WINDOWID.POPUP), GetPopupRect(), winPopup, "Material"); if (NgMaterial.GetTexture(m_SelectedMaterial, true) != null) { DrawPreviewMaterial(1, NgMaterial.GetTexture(m_SelectedMaterial, false)); DrawPreviewMaterial(0, NgMaterial.GetTexture(m_SelectedMaterial, true)); } else { if (NgMaterial.GetTexture(m_SelectedMaterial, false) != null) { DrawPreviewMaterial(0, NgMaterial.GetTexture(m_SelectedMaterial, false)); } } }