public static void ShowEditor(SWNodeMask node) { if (Instance != null) { Instance.Close(); } var window = EditorWindow.GetWindow <SWWindowDrawMask> (true, "Mask"); window.Init(node); window.InitOnce(); }
public void Init(SWNodeMask _node) { hasRightup = false; node = _node; SetLayerMask(node); ePopup_texRes = new SWEnumPopup(new string[] { "128x128", "256x256", "512x512", "1024x1024" }, (int)node.data.reso, SWEditorUI.MainSkin.button, delegate(int index){ node.data.reso = (SWTexResolution)index; pause = true; EditorCoroutineRunner.StartEditorCoroutine(ResizeTex(node.data.reso)); }); }
public Texture2D GetParentTexture() { if (GetParentNode().data.type == SWNodeType.mask) { SWNodeMask mask = (SWNodeMask)GetParentNode(); return(mask.texMask.Texture); //return mask.info.texPreview; } else { return(GetParentNode().Texture); } }
void ShowBG_Masks() { foreach (var item in SWWindowMain.Instance.NodeAll()) { if (!(item.Value is SWNodeMask)) { continue; } if (!node.data.layerMask.Has(item.Value.data.id)) { continue; } var dt = item.Value.data; SWNodeMask nodeMask = (SWNodeMask)item.Value; Material matBot = new Material(SWEditorUI.GetShader("RectTRSPremask")); Set_Material(matBot, -dt.effectData.t_startMove, dt.effectData.r_angle, dt.effectData.s_scale); Graphics.DrawTexture(drawRect, nodeMask.texMask.Texture, matBot); } }
public void Init(SWNodeMask _node) { node = _node; SetLayerMask(node); }