Ejemplo n.º 1
0
    void Update()
    {
        for (int i = 1; i <= Mathf.RoundToInt(points.Get(type)); i++)
        {
            if (i >= leftBracket.childCount)
            {
                Transform newBar = Instantiate(barPrefab) as Transform;
                newBar.parent        = leftBracket;
                newBar.localPosition = i * distanceBetweenBars;
                newBar.localScale    = Vector3.one;
            }
        }

        for (int i = Mathf.RoundToInt(points.Get(type)); i < leftBracket.childCount; i++)
        {
            Destroy(leftBracket.GetChild(i).gameObject);
        }

        Transform oldParent = rightBracket.parent;

        rightBracket.parent        = leftBracket;
        rightBracket.localPosition = ((int)points.GetMax(type) + 1) * distanceBetweenBars;
        rightBracket.parent        = oldParent;
    }
Ejemplo n.º 2
0
 public void ItShouldHave__Max__(float amount, string type)
 {
     it.GetMax(type).ShouldBe(amount);
 }
Ejemplo n.º 3
0
    void Update()
    {
        foreach (KeyValuePair <string, PointEventListener> listener in listeners)
        {
            listener.Value.Compare(previousValues[listener.Key], points.Get(listener.Key), points.GetMax(listener.Key));
        }

        foreach (Point point in points.points)
        {
            previousValues[point.type] = point.amount;
        }
    }