private void SpinCubeAroundX() { TweenShark.To(_cube.transform, 10, new TweenOps(GetSelectedEasingFunction()) .UV3CompBy("localEulerAngles", 600, V3Compnent.Right) .OnUpdate(t => Debug.Log("x: " + _cube.transform.localEulerAngles.x)) ); }
private void TweenButton() { TweenShark.To(_btn, 5, new TweenOps(Ease.InOutQuart) .Prop(new PropertyOps("X", 500, false).Ease(Ease.Linear)) .Prop(new PropertyOps("Y", 500, false).Ease(Ease.OutQuint)) ); }
private void SpinWasher(ComponentEvent e) { var dichWasher = GetDishWasher(); TweenShark.To(dichWasher.transform, 10, new TweenOps(Ease.InOutQuad) .UV3CompTo("localEulerAngles", 27000, V3Compnent.Up) ); }
private void SpinCubeAroundZ() { TweenShark.To(_cube, 10, new TweenOps(GetSelectedEasingFunction()) .URotateTo(1200, V3Compnent.Forward) .OnStart(t => Debug.Log("OnStart Progress = " + t.Progress)) .OnUpdate(t => _progressTextField.Text = "Progress: " + t.Progress) .OnComplete(t => Debug.Log("OnComplete Progress = " + t.Progress)) ); }
private void TweenMaterial() { TweenShark.To(_cube, GetTweenDuration(), new TweenOps(GetSelectedEasingFunction()) .UFadeMaterials(new Material[] { _cube.renderer.materials[1], _cube.renderer.materials[2] }) ); }
private void BringCubeTo(GameObject go, float forward, float right, float up, bool autoResume) { if (_tweenerSelection.Selected == 1) { iTween.Init(go); iTween.MoveTo(go, iTween.Hash( "x", right, "y", up, "z", forward, "Time", GetTweenDuration(), "onComplete", (Action <object>)((obj) => { if (autoResume) { BringCubeTo(go, (random.Next(700) - 350) / 100.0f, (random.Next(700) - 350) / 100.0f, (random.Next(500) - 250) / 100.0f, true) ; } }) ) ); } else { var ts = TweenShark.To(go, GetTweenDuration(), new TweenOps(GetSelectedEasingFunction()) // var ts = TweenShark.To(go, GetTweenDuration(), new TweenOps(EaseEx.InElastic, new object[] {0.1f, 0.5f}) .UMoveTo(new Vector3(right, up, forward)) // .UColorTo(new Color(random.Next(100) / 100.0f, random.Next(100) / 100.0f, random.Next(100) / 100.0f, random.Next(100) / 100.0f)) .OnComplete((obj) => { if (autoResume) { BringCubeTo(go, (random.Next(700) - 350) / 100.0f, (random.Next(700) - 350) / 100.0f, (random.Next(500) - 250) / 100.0f, true) ; } }) ); } }
private void OpenClose(ComponentEvent e) { var dichWasher = GetDishWasher(); var klappe = GetDishWasherKlappe(); if (klappe != null && dichWasher != null) { Debug.Log("local euler: " + klappe.transform.localEulerAngles); Debug.Log("abs euler: " + klappe.transform.eulerAngles); Debug.Log("local rotation: " + klappe.transform.localRotation); Debug.Log("rotation: " + klappe.transform.rotation); if (klappe.transform.localEulerAngles.x <= 10) { TweenShark.To(klappe.transform, 2, new TweenOps(Ease.InOutQuad) .UV3CompTo("localEulerAngles", -90, V3Compnent.Right) ); TweenShark.To(dichWasher.transform, 2, new TweenOps(Ease.OutQuad) .UV3CompTo("position", 5, V3Compnent.Up) ); } else { TweenShark.To(klappe.transform, 2, new TweenOps(Ease.InOutQuad) .UV3CompTo("localEulerAngles", 360, V3Compnent.Right) ); TweenShark.To(dichWasher.transform, 2, new TweenOps(Ease.InQuad) .UV3CompTo("position", 0, V3Compnent.Up) ); } } }
private void BringCubeVertical(float up) { TweenShark.To(_cube.transform, GetTweenDuration(), new TweenOps(GetSelectedEasingFunction()) .UV3CompBy("position", up, V3Compnent.Up) ); }
private void SpinCubeAroundY() { TweenShark.To(_cube, 10, new TweenOps(GetSelectedEasingFunction()) .URotateTo(1200, V3Compnent.Up) ); }
private void SetupUpGui() { // Initialize the loaders GuiModule.Initialize(this); // NetModule.Initialize(this); TweenSharkUnity3D.Initialize(this); _guiStage = GlobalGui.GetInstance(); _guiStage.AddChild( new Button(new Rect(20, 20, 100, 20), "BUTTON") .AddClickHandler(OnButtonInListClicked) ); _guiStage.AddChild( _youtubeBox = new Box(new Rect(600, 50, 20, 20), "Youtube Search") .SetAutoAdjustSize(true) .AddChild( _searchField = new TextField(new Rect(0, 30, 400, 20)) .AddMouseOverHandler(e => Debug.Log("mouse over on SearchField")) .AddMouseOutHandler(e => Debug.Log("mouse out on SearchField")) .AddLeftMouseDownHandler(e => Debug.Log("Left mouse down on SearchField")) .AddLeftMouseUpHandler(e => Debug.Log("Left mouse up on SearchField")) ) .AddChild( new Button(new Rect(480, 30, 100, 20), "Search") .AddClickHandler(OnButton1) .AddMouseOverHandler(e => Debug.Log("MouseOver search " + e.Target + " " + e.CurrentTarget)) .AddMouseOutHandler(e => Debug.Log("MouseOut search " + e.Target + " " + e.CurrentTarget)) ) .AddChild( new ScrollView(new Rect(0, 100, 580, 350)) .AddChild( _listView = new VGroup() .AddChild(new Label(new Rect(0, 0, 100, 20), "Text1")) .AddChild(new Label(new Rect(0, 30, 100, 20), "Text2")) .AddChild(new Label(new Rect(0, 60, 100, 20), "Text3")) .AddChild(new Label(new Rect(0, 90, 100, 20), "Text4")) .AddChild(new Label(new Rect(0, 120, 100, 20), "Text5")) .AddChild(new Label(new Rect(0, 150, 100, 20), "Text6")) .AddChild(new Label(new Rect(0, 180, 100, 20), "Text7")) .AddChild(new Label(new Rect(0, 210, 100, 20), "Text8")) .AddChild(new Label(new Rect(0, 240, 100, 20), "Text9")) .SetPadding(20) ) ) ); _listView .AddLeftMouseDownHandler(e => Debug.Log("Left mouse down on ListView")) .AddLeftMouseUpHandler(e => Debug.Log("Left mouse up on ListView")) .AddRightMouseDownHandler(e => Debug.Log("Right mouse down on ListView")) .AddRightMouseUpHandler(e => Debug.Log("Right mouse up on ListView")) .AddMiddleMouseDownHandler(e => Debug.Log("Middle mouse down on ListView")) .AddMiddleMouseUpHandler(e => Debug.Log("Middle mouse up on ListView")) ; if (_youtubeBox != null) { _guiStage.AddChild( new Button(new Rect(200, 20, 100, 20), "Start Tween") .AddClickHandler((e) => { var random = new System.Random(); var opt = new TweenOps(Ease.OutQuad) .PropTo("X", random.Next(800)) .PropTo("Y", random.Next(500)) .PropTo("PaddingTop", random.Next(100)) ; TweenShark.To(_youtubeBox, 1f + random.Next(2), opt); opt = new TweenOps(Ease.InOutQuad) .PropTo("_sbyte", 100) .PropTo("_byte", 100) .PropTo("_short", 100) .PropTo("_ushort", 100) .PropTo("_int", 100) .PropTo("_uint", 100) .PropTo("_long", 100) .PropTo("_ulong", 100) .PropTo("_float", 100) .PropTo("_double", 100) ; TweenShark.To(_tweenedObject, 10, opt); }) ); _youtubeBox.AddClickHandler(onBox1Clicked); } _guiStage.AddClickHandler(onStageClick); }