/************************************************************************************************************************/ private void OnEnable() { titleContent = new GUIContent(Name); Instance = this; if (_PackTextures == null) { _PackTextures = new PackTextures(); } if (_ModifySprites == null) { _ModifySprites = new ModifySprites(); } if (_RenameSprites == null) { _RenameSprites = new RenameSprites(); } if (_GenerateSpriteAnimations == null) { _GenerateSpriteAnimations = new GenerateSpriteAnimations(); } if (_RemapSpriteAnimation == null) { _RemapSpriteAnimation = new RemapSpriteAnimation(); } if (_RemapAnimationBindings == null) { _RemapAnimationBindings = new RemapAnimationBindings(); } _Panels = new Panel[] { _PackTextures, _ModifySprites, _RenameSprites, _GenerateSpriteAnimations, _RemapSpriteAnimation, _RemapAnimationBindings, new Settings(), }; _PanelNames = new string[_Panels.Length]; for (int i = 0; i < _Panels.Length; i++) { var panel = _Panels[i]; panel.OnEnable(i); _PanelNames[i] = panel.Name; } Undo.undoRedoPerformed += Repaint; OnSelectionChange(); }
// Update is called once per frame void Update() { if (frame-- == 0) { Profiler.BeginSample("Pack"); Packed = new Texture2D(0, 0); Rect[] rects = Packed.PackTextures(textures, 0); Profiler.EndSample(); Profiler.BeginSample("Compute"); rects = PackTextures.PackTexturesCompute(out Compute, textures); Profiler.EndSample(); for (int i = 0, imax = rects.Length; i < imax; i++) { Debug.Log(rects[i]); } renderer.material.mainTexture = Compute; } }
void Start() { PackTextures.LoadComputeShader(); }