Exemple #1
0
        public void RestoreFromPersistentState()
        {
            mode = m_State.lastMode;
            events.skinningModeChanged.Invoke(mode);

            SpriteCache lastSprite;
            var         hasLastSprite = m_SpriteMap.TryGetValue(m_State.lastSpriteId, out lastSprite);

            if (hasLastSprite)
            {
                selectedSprite = lastSprite;
            }
            else
            {
                vertexSelection.Clear();
            }

            BaseTool baseTool;

            if (m_ToolMap.TryGetValue(m_State.lastUsedTool, out baseTool))
            {
                selectedTool = baseTool;
            }
            else if (m_ToolMap.TryGetValue(Tools.EditPose, out baseTool))
            {
                selectedTool = baseTool;
            }

            var visibilityTool = m_ToolMap[Tools.Visibility];

            if (m_State.lastVisibilityToolActive)
            {
                visibilityTool.Activate();
            }
        }
Exemple #2
0
        public SpriteCache GetSprite(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(null);
            }

            SpriteCache sprite;

            m_SpriteMap.TryGetValue(id, out sprite);
            return(sprite);
        }