private void Start()
 {
     if (PBSoriginObj == null)
     {
         UndoManager.instance.PaintableObjs.TryGetValue(gameObject.name, out PBSoriginObj);
         if (PBSoriginObj == null)
         {
             Debug.Log("PaintableMiniature :: Can't find mapping Paintable Object.");
         }
     }
     else
     {
         GetComponent <Renderer>().material.SetTexture("_MainTex", PBSoriginObj.PaintTextureData.AlbedoTexture);
         originObj = PBSoriginObj.GetComponent <PaintableObject>();
     }
 }
Ejemplo n.º 2
0
        public bool PerformRedo()
        {
            if (currentPointer >= NumRecords - 1)
            {
                return(false);
            }

            int pointer = Mathf.Min(currentPointer + 1, NumRecords - 1);
            // Debug.Log("[UndoManager::InsertRecord] Load record at pointer " + currentPointer);
            string id = recordList[pointer].paintObjectID;

            if (paintableObjs.ContainsKey(id))
            {
                currentPointer = pointer;
                PaintableObject entry = paintableObjs[id];
                if (entry == null)
                {
                    return(false);
                }
                Graphics.Blit(recordList[currentPointer].texMap, entry.PaintTextureData.AlbedoTexture);
                return(true);
            }
            return(false);
        }