๐Scripting References
Everything is controlled by the RanksAnimationController.cs file.
Public Variables
int defaultSpawnAnimation;
The default animation that plays when this GameObject spawns or becomes active. 0 is none, 1 is breathing, and others are different spawn animations.
List<Rank> ranks;
List of all Ranks.
int currentRankIndex;
When a new rank is applied, its index in the ranks list is compared to this value and is used to determine whether to call Upgrade or Downgrade particles.
Rank currentRank;
It is a copy of the last applied rank, plus any modifications made manually. When applying a new rank, some rank variables don't need to be copied from the ranks list. So, if you require accurate information, getting the rank from the ranks list is better.
Body[] bodies;
A list of all borders with their supported insides and correct position, and rotation for wings.
Wing[] wings;
A list of everything required for wings to work.
Material[] materials;
An array of materials that are available as a shortcut in the Customize tab. Different methods can use the index of these materials to set them to the border, the inside, and the wings.
bool enableUpgradeEffect;
ParticleSystem upgradeParticle;
VisualEffect upgradeVisualEffect;
bool enableDowngradeEffect;
ParticleSystem downgradeParticle;
VisualEffect downgradeVisualEffect;
Methods
PlaySpawnAnimation(int target)
Plays an animation on the animator on the root of the game object.
ApplyRank(int index)
Retrieves the rank from the ranks list at the specified index and applies it.
If an invalid index is passed, it logs a warning message and returns. Doesn't print an error.
ApplyRank(string rankName)
Applies a rank from the ranks list by its exact name. If the rank is not found or the name is invalid, a warning is logged.
ApplyRank(Rank targetRank)
Applies the rank passed as parameter.
SetIcon(Rank targetRank);
Applies icon with the target rank's settings.
SetIcon(int icon);
Applies icon with the currentRank's animation settings.
DisableIcon()
Removes icon. This is same as calling SetIcon(0);
SetIconDirectly(int icon);
It applies the icon skipping any animation settings in the current rank.
SetIconPrimaryMaterial(int i)
Retrieves the appropriate material from the materials list based on the given index and applies it to the icon.
SetIconPrimaryMaterial(Material material)
Applies the material passed as parameter to the icon.
SetIconSecondaryMaterial(int i)
Retrieves the appropriate material from the materials list based on the given index and applies it to the icon.
SetIconSecondaryMaterial(Material material)
Applies the material passed as parameter to the icon.
DisableBorder()
Removes border and inside.
SetBorder(int newBorder,
bool autoUpdateInside = true,
bool autoUpdateWingsPosition = true)
Updates the border with the currentRank's border animation setting. Parameters: int newBorder Will disable the border if a negative value is passed as a parameter. bool autoUpdateInside = true If the current inside isn't viable for the new border, auto update will assign a new one. bool autoUpdateWingsPosition = true If wings are changed along with this, set it false so that this doesn't handle updating the position and changing wings updates that.
SetBorderMaterials(int i)
Retrieves the appropriate material from the materials list based on the given index and applies it to the border
SetBorderMaterials(Material material)
Applies the material passed as parameter to the border.
DisableInside()
Removes inside.
SetInside(int i)
Applies new inside according to currentRank's animation settings.
SetInside(Inside newInside)
Applies new inside according to currentRank's animation settings.
SetInsideMaterial(int i)
Retrieves the appropriate material from the materials list based on the given index and applies it to the inside
SetInsideMaterial(Material material)
Applies the material passed as parameter to the inside.
DisableWings()
Removes Wings
SetWing(int i)
SetWingsMaterial(int i)
Retrieves the appropriate material from the materials list based on the given index and applies it to the wings
SetWingsMaterial(Material mat)
Applies the material passed as parameter to the wings.
DisableEverything()
Removes icon, border, inside and wings.
Last updated