public void UpdateRotationPointAtTimestamp( float timestamp, Vector3 newPosition, Action callback) { // Check if timestamp passed as argument matches any in the // rotation path. var foundMatch = RotationPath.NodeAtTimeExists(timestamp); // If timestamp was not found.. if (!foundMatch) { Debug.Log( "You're trying to change rotation for nonexistent " + "node."); return; } RotationPath.MovePointToPosition(timestamp, newPosition); callback(); OnRotationPointPositionChanged(); }
/// <summary> /// Set rotation path node positions to the same as in anim. object /// path. /// </summary> private void ResetRotationPathValues() { var animPathNodePositions = GetNodePositions(); for (var i = 0; i < animPathNodePositions.Count; i++) { RotationPath.MovePointToPosition(i, animPathNodePositions[i]); } }
public void OffsetRotationPathPosition(Vector3 moveDelta) { // For each node.. for (var i = 0; i < NodesNo; i++) { var oldPosition = GetRotationPointPosition(i); var newPosition = oldPosition + moveDelta; // Update node positions. RotationPath.MovePointToPosition(i, newPosition); } }