public localRotation ( Quaternion endValue, bool isRelative = false ) : GoTweenConfig, | ||
endValue | Quaternion | |
isRelative | bool | |
리턴 | GoTweenConfig, |
static public int localRotation(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (matchType(l, argc, 2, typeof(UnityEngine.Quaternion), typeof(bool))) { GoTweenConfig self = (GoTweenConfig)checkSelf(l); UnityEngine.Quaternion a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); var ret = self.localRotation(a1, a2); pushValue(l, ret); return(1); } else if (matchType(l, argc, 2, typeof(UnityEngine.Vector3), typeof(bool))) { GoTweenConfig self = (GoTweenConfig)checkSelf(l); UnityEngine.Vector3 a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); var ret = self.localRotation(a1, a2); pushValue(l, ret); return(1); } return(error(l, "No matched override function to call")); } catch (Exception e) { return(error(l, e)); } }
void Awake() { if (affectedTransform == null) { Debug.LogError("affectedTransform must be filled in."); } // Grab all platforms affectedPlatforms = affectedTransform.GetComponentsInChildren <SetupTextPlatform>(); // Setup animation configuration itemAnimationConfiguration.setIterations((loopForever ? -1 : 1), loopType); itemAnimationConfiguration.setEaseType(animationType); // Setup scale and rotation itemAnimationConfiguration.localRotation(Quaternion.identity); itemAnimationConfiguration.scale(Vector3.one); itemAnimationConfiguration.localPosition(Vector3.zero); // Disable all parenting scripts if (disableParentingAutomatically == true) { ParentToRotateEverything[] allParentScripts = affectedTransform.GetComponentsInChildren <ParentToRotateEverything>(); foreach (ParentToRotateEverything parentScript in allParentScripts) { parentScript.enabled = false; } } }
private void keyDownDetector() { if (Input.GetKey (KeyCode.W)) { transform.Translate(new Vector3(0,0,Speed)); }else if(Input.GetKey (KeyCode.S)){ transform.Translate(new Vector3(0,0,-Speed)); }else if(Input.GetKey (KeyCode.A)){ transform.Translate(new Vector3(-Speed,0,0)); }else if(Input.GetKey (KeyCode.D)){ transform.Translate(new Vector3(Speed,0,0)); }else if(Input.GetKey (KeyCode.K)){ myShip.transform.Rotate(new Vector3(0,0,Speed)); }else if(Input.GetKey (KeyCode.L)){ myShip.transform.Rotate(new Vector3(0,0,-Speed)); } if (Input.GetKeyUp (KeyCode.K)) { GoTweenConfig config = new GoTweenConfig(); config.setIterations(1); config.localRotation(new Vector3(0,0,360)); config.easeType = GoEaseType.ExpoOut; Go.to(myShip.transform,0.5f,config); } else if (Input.GetKeyUp (KeyCode.L)) { GoTweenConfig config = new GoTweenConfig(); config.setIterations(1); config.localRotation(new Vector3(0,0,-360)); config.easeType = GoEaseType.ExpoOut; Go.to(myShip.transform,0.5f,config); } }
private void keyDownDetector() { if (Input.GetKey(KeyCode.W)) { transform.Translate(new Vector3(0, 0, Speed)); } else if (Input.GetKey(KeyCode.S)) { transform.Translate(new Vector3(0, 0, -Speed)); } else if (Input.GetKey(KeyCode.A)) { transform.Translate(new Vector3(-Speed, 0, 0)); } else if (Input.GetKey(KeyCode.D)) { transform.Translate(new Vector3(Speed, 0, 0)); } else if (Input.GetKey(KeyCode.K)) { myShip.transform.Rotate(new Vector3(0, 0, Speed)); } else if (Input.GetKey(KeyCode.L)) { myShip.transform.Rotate(new Vector3(0, 0, -Speed)); } if (Input.GetKeyUp(KeyCode.K)) { GoTweenConfig config = new GoTweenConfig(); config.setIterations(1); config.localRotation(new Vector3(0, 0, 360)); config.easeType = GoEaseType.ExpoOut; Go.to(myShip.transform, 0.5f, config); } else if (Input.GetKeyUp(KeyCode.L)) { GoTweenConfig config = new GoTweenConfig(); config.setIterations(1); config.localRotation(new Vector3(0, 0, -360)); config.easeType = GoEaseType.ExpoOut; Go.to(myShip.transform, 0.5f, config); } }
public void AnimatePositioningItem(Transform parentTo, System.Action <ItemPickup> endAnimationEvent, AudioType playSound = AudioType.None) { // Setup variables onAnimationEnd = endAnimationEvent; transform.parent = parentTo; // Setup animation configuration itemAnimationConfiguration.clearEvents(); itemAnimationConfiguration.clearProperties(); // Setup scale and rotation itemAnimationConfiguration.localRotation(Quaternion.identity); itemAnimationConfiguration.scale(Vector3.one); // Setup path itemTweenPath[0] = transform.localPosition; itemTweenPath[1] = new Vector3((transform.localPosition.x / 2f), midTweenOffset, 0); itemAnimationConfiguration.localPositionPath(new GoSpline(itemTweenPath)); // Check if we need to clean up the animation if (itemAnimation != null) { // Clean up this item animation from the animation queue Go.removeTween(itemAnimation); itemAnimation = null; } // Create and play a new animation itemAnimation = Go.to(transform, animationDuration, itemAnimationConfiguration); itemAnimation.setOnCompleteHandler(OnAnimationEnds); itemAnimation.play(); // Play a sound effect if (playSound == AudioType.Place) { PlayClip(dropSound); } else if (playSound == AudioType.PickUp) { PlayClip(pickupSound); } }