Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        public void UpdateRotationPathWithAddedKeys()
        {
            var pathTimestamps = GetPathTimestamps();

            // For each timestamp in the path..
            foreach (var pathTimestamp in pathTimestamps)
            {
                // Check if key at timestamp exists in rotation path.
                var keyExists = RotationPath.NodeAtTimeExists(pathTimestamp);

                // If not..
                if (!keyExists)
                {
                    CreateRotationPoint(pathTimestamp);
                }
            }
        }