This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Extension method for the Transform class, Destroys all of its children starting at a given index (optional, default 0). | |
/// </summary> | |
/// <param name="container">The transform containing the child objects.</param> | |
/// <param name="startIndex">The index at which we should begin destroying the objects.</param> | |
public static void Clear(this Transform container, int startIndex = 0) | |
{ | |
for (int i = startIndex; i < container.childCount; i++) | |
{ | |
Destroy(container.GetChild(i).gameObject); //Use ObjectPool.Destroy to use with pooling system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Fraction | |
{ | |
public int numerator; | |
public int denominator; | |
public Fraction(int numerator, int denominator) | |
{ | |
this.numerator = numerator; | |
this.denominator = denominator; | |
} |