// ---------------------------------------------------------------- // Update Things // ---------------------------------------------------------------- private void UpdateAngleLengthPosition() { // Update values angle = LineUtils.GetAngle_Degrees(startPos, endPos); length = LineUtils.GetLength(startPos, endPos); // Transform sprite! if (float.IsNaN(endPos.x)) { Debug.LogError("Ahem! A SpriteLine's endPos is NaN! (Its startPos is " + startPos + ".)"); } this.transform.localPosition = LineUtils.GetCenterPos(startPos, endPos); this.transform.localEulerAngles = new Vector3(0, 0, angle); GameUtils.SizeSpriteRenderer(sprite, length, thickness); }
// ---------------------------------------------------------------- // Update Things // ---------------------------------------------------------------- private void UpdateAngleLengthPosition() { // Update values angle = LineUtils.GetAngle_Degrees(startPos, endPos); length = LineUtils.GetLength(startPos, endPos); // Transform image! if (float.IsNaN(endPos.x)) { Debug.LogError("Ahem! An ImageLine's endPos is NaN! (Its startPos is " + startPos + ".)"); } this.GetComponent <RectTransform>().anchoredPosition = LineUtils.GetCenterPos(startPos, endPos); //.transform.localPosition this.transform.localEulerAngles = new Vector3(0, 0, angle); SetThickness(thickness); }