public override void Update() { //Ugly move code currentPos = Vector2.Clamp(currentPos, -Vector2.One, Vector2.One); transform.position += new Vector3(currentPos.x, 0, -currentPos.y) * Time.DeltaTime; //Weight update for (uint i = 0; i < nodes.Count; i++) { AnimationNode node = nodes[(int)i]; weight.setWeight(i, new WeightTripple(node.GetWeight(currentPos))); } }
public override void Update() { if (BlendNodes.ContainsKey(State)) { Skin.setBlendTreeNode(BlendNodes[State]); for (uint i = 0; i < Animations[State].Count; i++) { AnimationNode node = Animations[State][(int)i]; if (node != null) { if (State != ChadControls.STATE.THROWING) // set throwing weights from chadControls instead { WeightHandles[State].setWeight(i, node.GetWeight(Direction)); //node.Node.getTimeHandle().SetSpeed(1); AnimationSpeed(node, 1); } else if (!Throwing && i == 1) // not throwing and index handling throwing anim { WeightHandles[State].setWeight(i, 0); // set throwing anim weight to 0 //node.Node.getTimeHandle().SetSpeed(2.2f); AnimationSpeed(node, 2.4f); } else if (i == 1) // throw anim { AnimationSpeed(node, 2.4f); } //node.Node.getTimeHandle().SetSpeed(2.2f); else if (Chad.PickedUpObject) // charge throw anim { AnimationSpeed(node, 2.6f / Chad.PickedUpObject.chargeTimeMax); } //node.Node.getTimeHandle().SetSpeed(2.6f / Chad.PickedUpObject.chargeTimeMax); } else { Debug.Log("Animation not found for: " + State + i); } } } }