Table of Contents
Extensions for Models
public static class ModelExt
Inheritance System.Object ModelExt
Add multiple Child Dependants at the same time. Equivalent to calling the (weirdly non plural named) Model.AddChild
method but without having to do an ICollection cast
public static void AddChildDependants<T>(this Model model, System.Collections.Generic.IEnumerable<T> children)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
children
System.Collections.Generic.IEnumerable<T>
Duplicates a model and also sets its name to something new
public static T Duplicate<T>(this T model, string name)
where T : Model;
T
Type of object you want to cast to when duplicating. Done automatically
model
T
name
System.String
Create a new and separate copy of this object. Same as using: .Clone().Cast();
public static T Duplicate<T>(this T model)
where T : Model;
T
Type of object you want to cast to when duplicating. Done automatically
model
T
Finds the first descendent of a given type whose name contains the specified string, or null if not found
public static T FindDescendant<T>(this Model model, string nameContains)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
nameContains
System.String
Finds the first descendent of a given type that matches the given condition, or null if not found
public static T FindDescendant<T>(this Model model, System.Predicate<T> condition)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
condition
System.Predicate<T>
Finds the descendents of a given type whose name contains the specified string
public static T[] FindDescendants<T>(this Model model, string nameContains)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
nameContains
System.String
Finds the descendents of a given type that matches the given condition
public static T[] FindDescendants<T>(this Model model, System.Predicate<T> condition)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
condition
System.Predicate<T>
Finds the descendents of a given type
public static T[] FindDescendants<T>(this Model model)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
Returns whether a model has a descendant of a given type with a filtered name, providing it via the out parameter if so
public static bool HasDescendant<T>(this Model model, string nameContains, out T t)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
nameContains
System.String
t
T
Returns whether a model has a descendant of a given type, providing it via the out parameter if so
public static bool HasDescendant<T>(this Model model, out T t)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
t
T
Returns whether a model has a descendant of a given type
public static bool HasDescendant<T>(this Model model)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
Remove multiple Child Dependants at the same time. Equivalent to calling the (weirdly non plural named) Model.RemoveChild
method but without having to do an ICollection cast
public static void RemoveChildDependants<T>(this Model model, System.Collections.Generic.IEnumerable<T> children)
where T : Model;
T
model
Il2CppAssets.Scripts.Models.Model
children
System.Collections.Generic.IEnumerable<T>
Sets the name of this model, properly appending the type prefix to it.
Also sets the id if it's a ProjectileModel
public static T SetName<T>(this T model, string name)
where T : Model;
T
model
T
name
System.String