/// <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(); }
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); }
/// <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; }
public TSSState(TSSCore core, TSSItem item) { this.core = core; activators.Add(new TSSItemActivator(item)); }
/// <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(); }
/// <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()); }
/// <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()); }
/// <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()); }
public void Refresh() { item = GetComponent <TSSItem>(); }
public TSSTween(TSSItem item) { this.item = item; this.matProperty = null; }