Example #1
0
 public int GetNextFreePropertyIndex(ScriptableProperty.ScriptableType type)
 {
     if (type == ScriptableProperty.ScriptableType.Default)
     {
         lastUsedEventIndex++;
         return(lastUsedEventIndex);
     }
     else
     {
         lastUsedAnimationIndex++;
         return(lastUsedAnimationIndex);
     }
 }
Example #2
0
        /// <summary>
        /// Gets the index of the property.
        /// Each property has to have unique index for this view type.
        /// </summary>
        /// <returns>The property index.</returns>
        /// <param name="viewName">The view name.</param>
        /// <param name="viewType">The view type.</param>
        /// <param name="type">Type.</param>
        public int GetPropertyIndex(string viewName, System.Type viewType, ScriptableProperty.ScriptableType type)
        {
            PropertyRange range;

            if (!propertyRange.TryGetValue(viewName, out range))
            {
                // view not found, register it now
                range = RegisterView(viewName, viewType);
            }

            int index = range.GetNextFreePropertyIndex(type);

            // update the dictionary
            propertyRange[viewName] = range;

            return(index);
        }