public void StartAnimation(SegmentContainer segmentContainer) { this.segmentContainer = segmentContainer; Vector3 currentPos = new Vector3(bounds.xMin, bounds.y - bounds.height, 0.0f); float maxWidth = bounds.width; textObjects = new GameObject[segmentContainer.Segments.Count]; for (int i = 0; i < segmentContainer.Segments.Count; i++) { Segment segment = segmentContainer.Segments[i]; GameObject gameObject = Instantiate(largeTextPrefab); TextMesh textMesh = gameObject.GetComponent <TextMesh>(); textMesh.text = segment.Text; textMesh.transform.parent = transform; textMesh.transform.localPosition = new Vector3(currentPos.x, currentPos.y, currentPos.z); TextUtils.WrapTextMesh(textMesh, maxWidth); textObjects[i] = textMesh.gameObject; Renderer renderer = textMesh.GetComponent <Renderer>(); currentPos.y -= renderer.bounds.size.y; } }
public void StartAnimation(SegmentContainer segmentContainer) { this.segmentContainer = segmentContainer; // currentSegmentIndex = 0; Vector3 currentPos = new Vector3(bounds.xMin, bounds.y - bounds.height, 0.0f); // Vector3 currentPos = new Vector3 (bounds.xMin, bounds.y, 0.0f); float maxWidth = bounds.width; textObjects = new GameObject[segmentContainer.Segments.Count]; for (int i = 0; i < segmentContainer.Segments.Count; i++) { Segment segment = segmentContainer.Segments[i]; GameObject gameObject = Instantiate(largeTextPrefab); TextMesh textMesh = gameObject.GetComponent <TextMesh>(); textMesh.text = segment.Text; textMesh.transform.parent = transform; textMesh.gameObject.transform.position = new Vector3(currentPos.x, currentPos.y, currentPos.z); TextUtils.WrapTextMesh(textMesh, maxWidth); textObjects[i] = textMesh.gameObject; Renderer renderer = textMesh.GetComponent <Renderer>(); // Color color = new Color(renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, 0.0f); // renderer.material.color = color; currentPos.y -= renderer.bounds.size.y; } // StartCoroutine (AnimateInNextSegment ()); }
void FinishAnimation() { Debug.Log("animation completed"); foreach (GameObject textObject in textObjects) { Destroy(textObject); } textObjects = null; segmentContainer = null; animationCompleted(this); }
private void SetupContainers() { _systemSetupContainer = new SystemSetupContainer(this); _trackSolutionContainer = new TrackSolutionContainer(this); _segmentContainer = new SegmentContainer(this); _beaconDownloadConfigContainer = new BeaconDownloadConfigContainer(this); _loopContainer = new LoopContainer(this); _transponderContainer = new TransponderContainer(this); _transponderGroupContainer = new TransponderGroupContainer(this); _ioterminalContainer = new IOTerminalContainer(this); _decoderContainer = new DecoderContainer(this); _decoderPresetGroupContainer = new DecoderPresetGroupContainer(this); _competitorContainer = new CompetitorContainer(this); }
protected void Split(int k, out ISegmentContainer sc1, out ISegmentContainer sc2, bool keep) { //Contract.Requires(k < Count); //Contract.Ensures(sc1 != null); //Contract.Ensures(sc2 != null); int sc1Count = k + (keep ? 1 : 0); int sc2Count = Count - k - 1; sc1 = new SegmentContainer(sc1Count); sc2 = new SegmentContainer(sc2Count); for (int i = 0; i < sc1Count; i++) { sc1.Append(this[i]); } for (int i = k + 1; i < Count; i++) { sc2.Append(this[i]); } }
/// <summary> /// Splits this container at position <paramref name="k"/>. The first <paramref name="k"/> /// elements of the container are stored in <paramref name="container1"/> and the remainder /// in <paramref name="container2"/>. /// </summary> /// <param name="k">The index where the container should be split.</param> /// <param name="container1">The container which contains the elements before <paramref name="k"/>.</param> /// <param name="container2">The container which contains the elements after <paramref name="k"/>.</param> /// <param name="keep">Indicates if <paramref name="k"/>th item should be kept in <paramref name="container1"/> or not.</param> protected void Split( int k, [NotNull] out ISegmentContainer container1, [NotNull] out ISegmentContainer container2, bool keep) { Debug.Assert(k < Count); int container1Count = k + (keep ? 1 : 0); int container2Count = Count - k - 1; container1 = new SegmentContainer(container1Count); container2 = new SegmentContainer(container2Count); for (int i = 0; i < container1Count; ++i) { container1.Append(this[i]); } for (int i = k + 1; i < Count; ++i) { container2.Append(this[i]); } }
void LoadSuccess(SegmentContainer container) { Debug.Log("Loaded " + container.Segments.Count + " segments"); textAnimation.StartAnimation(container); }
void LoadSuccess(SegmentContainer container) { Debug.Log("Loaded " + container.Segments.Count + " segments"); }