public static void CaptureItemPath(TSSItem item, ItemKey key) { if (item.path != null && item.path.enabled) { if (item.path.loop) { item.path.SetPointPos(0, TSSPathBase.ToLocal(item.path, item.transform.position), true); item.path.SetPointPos(0, TSSPathBase.ToLocal(item.path, item.transform.position), true); item.values.positions[0] = item.transform.localPosition; item.values.positions[1] = item.transform.localPosition; return; } item.path.SetPointPos(key == 0 ? 0 : item.path.count - 1, TSSPathBase.ToLocal(item.path, item.transform.position)); item.path.UpdateSpacedPoints(); } }
public static void InitValues(ref TSSItemValues values) { if (values.inited) { return; } values.inited = true; values.startAction = ActivationMode.closeBranchImmediately; values.activations = new ActivationMode[stateCount] { ActivationMode.closeBranch, ActivationMode.openBranch }; values.delays = new float[stateCount]; values.durations = new float[stateCount] { 1, 1 }; values.childBefore = new bool[stateCount]; values.chainDirections = new ChainDirection[stateCount]; values.chainDelays = new float[stateCount] { 0.2f, 0.2f }; values.brakeChainDelay = true; values.firstChildDelay = new float[stateCount] { 0.2f, 0.2f }; values.buttonDuration = 0.5f; values.onKeyboard = new List <KeyCode>(); values.positions = new Vector3[stateCount] { Vector3.zero, Vector3.zero }; values.rotations = new Quaternion[stateCount] { Quaternion.identity, Quaternion.identity }; values.eulerRotations = new Vector3[stateCount] { Vector3.zero, Vector3.zero }; values.scales = new Vector3[stateCount] { Vector3.one, Vector3.one }; values.colors = new Color[stateCount] { Color.white, Color.white }; values.alphas = new float[stateCount] { 0, 1 }; values.imageFills = new float[stateCount] { 0, 1 }; values.numbers = new float[stateCount] { 0, 100 }; values.texts = new string[stateCount]; values.rects = new Vector4[stateCount]; values.anchors = new Vector4[stateCount]; values.anchorPositions = new Vector2[stateCount] { Vector3.zero, Vector3.zero }; values.intensities = new float[stateCount] { 0, 1 }; values.lightRange = new float[stateCount] { 0, 1 }; values.soundRange = new float[stateCount] { 0, 1 }; values.sphereRange = new float[stateCount] { 0, 1 }; values.floatFormat = "0"; values.path = TSSPathBase.GetDefaultPath(); values.pathSmoothFactor = 0.5f; values.pathResolution = 1; values.pathSpacing = 10; values.rotationMask = Vector3.one; values.timeScaled = true; }