internal string Evaluate(AddressableAssetProfileSettings ps, string profileId)
            {
                if (InlineUsage)
                {
                    return(ps.EvaluateString(profileId, Id));
                }

                return(Evaluate(ps, profileId, Id));
            }
Esempio n. 2
0
 /// <summary>
 /// Evaluate the profile value using the provided profile settings object and a profile id.
 /// </summary>
 /// <param name="profileSettings">The profile settings object.</param>
 /// <param name="profileId">The profile id.</param>
 /// <returns>The evaluated string stored in the referenced profile variable.</returns>
 public string GetValue(AddressableAssetProfileSettings profileSettings, string profileId)
 {
     if (profileSettings == null)
     {
         Debug.LogWarning("ProfileValueReference: AddressableAssetProfileSettings object is null.");
         return(null);
     }
     if (string.IsNullOrEmpty(profileId))
     {
         Debug.LogWarning("ProfileValueReference: GetValue called with invalid profileId.");
         return(null);
     }
     return(profileSettings.EvaluateString(profileId, profileSettings.GetValueById(profileId, m_Id)));
 }
            internal BuildProfile(string name, BuildProfile copyFrom, AddressableAssetProfileSettings ps)
            {
                m_InheritedParent = null;
                id          = GUID.Generate().ToString();
                profileName = name;
                values.Clear();
                m_ProfileParent = ps;

                if (copyFrom != null)
                {
                    foreach (var v in copyFrom.values)
                    {
                        values.Add(new ProfileEntry(v));
                    }
                    m_InheritedParent = copyFrom.m_InheritedParent;
                }
            }
            internal void SetName(string newName, AddressableAssetProfileSettings ps)
            {
                if (!ps.ValidateNewVariableName(newName))
                {
                    return;
                }

                var currRefStr = "[" + m_Name + "]";
                var newRefStr  = "[" + newName + "]";

                m_Name = newName;

                foreach (var p in ps.profiles)
                {
                    p.ReplaceVariableValueSubString(currRefStr, newRefStr);
                }
            }
            internal void SetName(string newName, AddressableAssetProfileSettings ps)
            {
                if (!ps.ValidateNewVariableName(newName))
                {
                    return;
                }

                var currRefStr = "[" + m_Name + "]";
                var newRefStr  = "[" + newName + "]";

                m_Name = newName;

                foreach (var p in ps.profiles)
                {
                    foreach (var v in p.values)
                    {
                        v.value = v.value.Replace(currRefStr, newRefStr);
                    }
                }

                ps.SetDirty(AddressableAssetSettings.ModificationEvent.ProfileModified, null, false);
                ProfileWindow.MarkForReload();
            }
 internal void OnAfterDeserialize(AddressableAssetProfileSettings ps)
 {
     m_ProfileParent = ps;
 }
            internal static string Evaluate(AddressableAssetProfileSettings ps, string profileId, string idString)
            {
                string baseValue = ps.GetValueById(profileId, idString);

                return(ps.EvaluateString(profileId, baseValue));
            }