Ejemplo n.º 1
0
 public void SetTargetData(Dictionary <string, BookmarkTarget> nameTargetMap)
 {
     if (nameTargetMap.ContainsKey(targetGameObjectName))
     {
         // Set the data on the bookmark target
         object         data   = GetData();
         BookmarkTarget target = nameTargetMap[targetGameObjectName];
         target.SetTargetComponentData(data);
     }
     else
     {
         Debug.LogWarning($"{nameof(BookmarkData)}: " +
                          $"cannot set the data on any bookmark target because " +
                          $"no bookmark target could be found with the name {targetGameObjectName}. " +
                          $"Bookmark targets given: {string.Join(", ", nameTargetMap.Values)}");
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a bookmark data that holds the information
 /// of a specific bookmark target
 /// </summary>
 /// <param name="target"></param>
 /// <returns></returns>
 public static BookmarkData Create(BookmarkTarget target)
 {
     return(new BookmarkData(target.name, target.GetTargetComponentData()));
 }