Exemple #1
0
        /// <summary>
        /// Record values from specified profile to item
        /// </summary>
        /// <param name="item">item pointer</param>
        /// <param name="profile">profile pointer</param>
        public static void ProfileRevert(TSSItem item, TSSProfile profile)
        {
            if (string.IsNullOrEmpty(profile.version))
            {
                profile.version = TSSInfo.version;
            }

            if (profile.version.Substring(0, 3) != TSSInfo.version.Substring(0, 3))
            {
                Debug.LogWarningFormat("TSS Profile version ({0}) is mismatch the version of the installed TSS plugin version ({1}).", profile.version, TSSInfo.version);
                return;
            }

            item.values      = profile.values;
            item.values.path = profile.values.path.Clone();
            item.tweens      = profile.tweens.Clone(item);

            item.values.colors = new Color[TSSItemBase.stateCount]
            {
                profile.values.colors[0],
                profile.values.colors[1]
            };

            item.CloseBranchImmediately();
        }
Exemple #2
0
        public static List <TSSTween> Clone(this List <TSSTween> sourceList, TSSItem parent)
        {
            List <TSSTween> resultList = new List <TSSTween>();

            for (int i = 0; i < sourceList.Count; i++)
            {
                resultList.Add(new TSSTween(parent)
                {
                    customEase      = sourceList[i].customEase.Clone(),
                    enabled         = sourceList[i].enabled,
                    startPoint      = sourceList[i].startPoint,
                    endPoint        = sourceList[i].endPoint,
                    mode            = sourceList[i].mode,
                    type            = sourceList[i].type,
                    closingType     = sourceList[i].closingType,
                    direction       = sourceList[i].direction,
                    effect          = sourceList[i].effect,
                    matPropertyType = sourceList[i].matPropertyType,
                    matProperty     = sourceList[i].matProperty.Clone(),
                    blendFactor     = sourceList[i].blendFactor
                });
            }

            return(resultList);
        }
Exemple #3
0
        /// <summary>
        /// Record values from specified item to profile
        /// </summary>
        /// <param name="item">item pointer</param>
        /// <param name="profile">profile pointer</param>
        public static void ProfileApply(TSSItem item, TSSProfile profile)
        {
            profile.values      = item.values;
            profile.values.path = item.values.path.Clone();
            profile.tweens      = item.tweens.Clone(null);

            profile.isUI = (item.rect != null);

            profile.values.colors = new Color[TSSItemBase.stateCount]
            {
                item.values.colors[0],
                item.values.colors[1]
            };

            profile.version = TSSInfo.version;
        }
Exemple #4
0
 public TSSState(TSSCore core, TSSItem item)
 {
     this.core = core;
     activators.Add(new TSSItemActivator(item));
 }
Exemple #5
0
 /// <summary>Remove activator from state by specified item</summary>
 /// <param name="item">item identifier</param>
 public void RemoveItem(TSSItem item)
 {
     activators = activators.Where(a => a.item != item).ToList();
 }
Exemple #6
0
 /// <summary>Add activator to state with specified item</summary>
 /// <param name="item">item identifier</param>
 /// <returns>Activator pointer</returns>
 public TSSItemActivator AddItem(TSSItem item)
 {
     activators.Add(new TSSItemActivator(item));
     return(activators.Last());
 }
Exemple #7
0
 /// <summary>
 /// Add a new state to this <b>core</b> (with default identifier)
 /// </summary>
 /// <returns>State pointer</returns>
 /// <param name="item">first item pointer in group (maybe a null)</param>
 public TSSState AddState(TSSItem item)
 {
     states.Add(new TSSState(this, item));
     return(states.Last());
 }
Exemple #8
0
 /// <summary>Add a new state to this core</summary>
 /// <returns>State pointer</returns>
 /// <param name="item">first item pointer in group (maybe a null)</param>
 /// <param name="stateName">state identifier</param>
 public TSSState AddState(TSSItem item, string stateName)
 {
     AddState(item).name = stateName;
     return(states.Last());
 }
Exemple #9
0
 public void Refresh()
 {
     item = GetComponent <TSSItem>();
 }
Exemple #10
0
 public TSSTween(TSSItem item)
 {
     this.item        = item;
     this.matProperty = null;
 }