示例#1
0
 /// <summary>
 /// Returns the recordable index with given "name".
 /// </summary>
 public int GetRecordableIndex(string name, string objectName)
 {
     Recordable.Config recordable = GetRecordable(name, objectName);
     if (recordable == null)
     {
         return(-1);
     }
     return(recordables.IndexOf(recordable));
 }
示例#2
0
        /// <summary>
        /// Add new recordable config.
        /// </summary>
        public void AddRecordable(Recordable.Config config)
        {
            if (config.ObjectToRecord == null)
            {
                Debug.LogError("Recordable doesnt have the object to record!");
                return;
            }

            config.Init();
            if (runtimePaths.ContainsKey(config.ObjectName))
            {
                int index = recordables.IndexOf(recordables.FirstOrDefault(x => x.ObjectName == config.ObjectName));
                recordables[index] = config;
            }
            else
            {
                recordables.Add(config);
                runtimePaths.Add(config.ObjectToRecord.name, new Recordable.Runtime(config.Name, config.ObjectToRecord.name, config.Color));
            }
        }