public StartTrail ( float timeToTweenTo, float fadeInTime ) : void | ||
timeToTweenTo | float | |
fadeInTime | float | |
리턴 | void |
// // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Alpha1)) { animationController.PlayAnimation(animationAttack01); // swordSwipe.StartTrail(0.5f, 0.4f); // Fades the trail in swordSwipe.SetTime(0f, 0, 1.0f); swordSwipe.StartTrail(0.5f, 0.4f); // Fades the trail in swordSwipe.FadeOut(0.1f); // swordSwipe.SetTime(2.0f, 2.5f, 2.0f); Debug.Log("-------- 1"); //swordSwipe.SetTime(tTraillTime, tTimeToTween, tTweenSpeed); //swordSwipe.StartTrail(startTimeToTweenTo, startFadeInTime); StartCoroutine(GenerateWeaponArc(0.12f, transform.position, Quaternion.Euler(0, 0, -60.0f))); } if (Input.GetKeyDown(KeyCode.Alpha2)) { animationController.PlayAnimation(animationAttack02); //swordSwipe.SetTime(0f, 0, 1.0f); //swordSwipe.StartTrail(0.9f, 1.5f); // Fades the trail in Debug.Log("-------- 2"); swordSwipe.SetTime(tTraillTime, tTimeToTween, tTweenSpeed); swordSwipe.StartTrail(startTimeToTweenTo, startFadeInTime); StartCoroutine(GenerateWeaponArc(0.1f, transform.position, Quaternion.Euler(0, 0, -50.0f))); StartCoroutine(GenerateWeaponArc(0.3f, transform.position, Quaternion.Euler(0, 0, 60.0f))); } if (Input.GetKeyDown(KeyCode.Alpha3)) { animationController.PlayAnimation(animationAttack03); //swordSwipe.SetTime(2f, 3f, 1.0f); //swordSwipe.StartTrail(0.5f, 1.5f); // Fades the trail in // swordSwipe.FadeOut(0.5f); Debug.Log("-------- 3"); swordSwipe.SetTime(tTraillTime, tTimeToTween, tTweenSpeed); swordSwipe.StartTrail(startTimeToTweenTo, startFadeInTime); StartCoroutine(GenerateWeaponArc(0.2f, transform.position, Quaternion.Euler(0, 0, 65.0f))); } }
public void showTrail() { //设置拖尾时长 myTrail.SetTime(2.0f, 0.0f, 1.0f); //开始进行拖尾 myTrail.StartTrail(0.5f, 0.4f); }
public void heroAttack() { //设置拖尾时长 currentWeaponTrail.SetTime(2.0f, 0.0f, 1.0f); //开始进行拖尾 currentWeaponTrail.StartTrail(0.5f, 0.4f); }
/// <summary> /// 启用拖尾效果 /// </summary> public void StartTrail() { //设置拖尾时长 myTrail.SetTime(2.0f, 0.0f, 1.0f); //开始进行拖尾 myTrail.StartTrail(0.5f, 0.4f); }
/// <summary> /// 开始进行拖尾 /// </summary> public void TrailsStart() { //设置拖尾时长 myTrail.SetTime(2.0f, 0.0f, 1.0f); myTrail.StartTrail(0.5f, 0.4f); }
/// <summary> /// 开始进行拖尾 /// </summary> public void StartTrails() { //设置拖尾时长 myTrail.SetTime(2.0f, 0.0f, 1.0f); myTrail.StartTrail(0.5f, 0.4f); }
public void StartTrails() { //set time myTrail.SetTime(2.0f, 0.0f, 1.0f); //start trail myTrail.StartTrail(0.5f, 0.4f); }
//开启残影函数(用于动画关键帧调用) public void TrailStart() { Debug.Log("TrailStart..."); //设置拖尾时长 TrailObj.SetTime(0.3f, 0.3f, 1.0f); //开始进行拖尾 TrailObj.StartTrail(0.5f, 0.4f); }
public override void AE_StartAttack() { if (trail) { trail.StartTrail(); } weapon.StartAttack(); }
public override void AE_StartAttack() { if (trail) { trail.StartTrail(); } weapon.StartAttack(); camShaker.ShakeCaller(0.1f, 0.2f); }
public void heroAttack() { //设置拖尾时长 myTrail.SetTime(0.3f, 0.3f, 1.0f); //开始进行拖尾 myTrail.StartTrail(0.5f, 0.4f); }
public virtual IEnumerator _WeaponOn(float delay) { if (delay > 0) { yield return(new WaitForSeconds(delay)); } FrontBlade.active = true; BackBlade.active = true; frontTrail.StartTrail(0.5f, 0.4f); backTrail.StartTrail(0.5f, 0.4f); GlobalAudioSystem.PlayAudioData(unit.AudioDataDict[WeaponOnSoundEffectName]); }
/// <summary> /// 播放拖尾效果 /// </summary> public void PlayTrailEffect() { if (weaponTrail == null) { return; } //设置拖尾时长 weaponTrail.SetTime(2.0f, 0.0f, 1.0f); //开始进行拖尾 weaponTrail.StartTrail(0.5f, 0.4f); }
public void Fly() { isReleased = true; AudioPlay(fly); isFly = true; //设置拖尾时长 trail.SetTime(0.2f, 0.0f, 1.0f); //开始进行拖尾 trail.StartTrail(0.5f, 0.4f); //springJoint失效 sj2d.enabled = false; }
void Update() { int curAnimaTag = animator.GetCurrentAnimatorStateInfo(0).tagHash; int curTransitionNameHash = animator.GetAnimatorTransitionInfo(0).userNameHash; bool isInTransition = animator.IsInTransition(0); if ((curAnimaTag == AnimaConstant.TagAtk && !isInTransition) || curTransitionNameHash == AnimaConstant.TransitionToAttack) { //设置拖尾时长 myTrail.SetTime(0.1f, 0.0f, 1.0f); //开始进行拖尾 myTrail.StartTrail(0.1f, 0.1f); } else { myTrail.ClearTrail(); } }
// #endregion // ------------------------------------------------------------------------------------------------------------------- #region Update // protected void Update() { t = Mathf.Clamp(Time.deltaTime * timeScale, 0, 0.066f); // animationController.SetDeltaTime(t); // Sets the delta time that the animationController uses. // // // This is just some sample code to show you how you can use the animation controller component along with the trails // thinkTime -= t; if (thinkTime < 0) { switch (thinkState) { case 0: animationController.CrossfadeAnimation(animationIdle, 0.2f); thinkState++; thinkTime = 1.5f; break; case 1: // START ATTACK 1 animationController.CrossfadeAnimation(animationAttack1Anticipation, 0.1f); thinkState++; thinkTime = 0.3f; facingAngle = -180 + Random.value * 360; break; case 2: animationController.PlayAnimation(animationAttack1); thinkTime = 0.2f; thinkState++; rightSwipe.StartTrail(0.5f, 0.4f); // Fades the trail in facingAngle += -40 + Random.value * 80; break; case 3: thinkState++; thinkTime = 0.3f; rightSwipe.FadeOut(0.5f); // Fades the trail out break; case 4: // BACK TO IDLE animationController.CrossfadeAnimation(animationIdle, 0.2f); thinkState++; thinkTime = 0.3f; rightSwipe.ClearTrail(); // Forces the trail to clear break; case 5: // START ATTACK 2 animationController.CrossfadeAnimation(animationAttack2Anticipation, 0.1f); thinkState++; thinkTime = 0.3f; facingAngle = -180 + Random.value * 360; break; case 6: animationController.PlayAnimation(animationAttack2); thinkState++; thinkTime = 0.2f; leftSwipe.StartTrail(0.5f, 0.4f); // Fades the trail in facingAngle += -40 + Random.value * 80; break; case 7: thinkState++; thinkTime = 0.3f; leftSwipe.FadeOut(0.5f); // Fades the trail out break; case 8: // BACK TO IDLE animationController.CrossfadeAnimation(animationIdle, 0.2f); thinkState++; thinkTime = 0.3f; leftSwipe.ClearTrail(); // Forces the trail to clear break; case 9: // START THE SPIN ATTACK animationController.CrossfadeAnimation(animationAttack1Anticipation, 0.1f); thinkState++; thinkTime = 0.3f; facingAngle = -180 + Random.value * 360; break; case 10: animationController.CrossfadeAnimation(animationWhirlwind, 0.2f); thinkState++; thinkTime = 2.8f; leftSwipe.StartTrail(0.9f, 1.4f); // Fades both trais in rightSwipe.StartTrail(0.9f, 1.4f); break; case 11: // Checking for a specific place in the animation from which to start the next animation // if (Mathf.Repeat(animationWhirlwind.normalizedTime, 1) < 0.93f + t * 1f && Mathf.Repeat(animationWhirlwind.normalizedTime, 1) > 0.93f - t * 1.2f) { animationController.CrossfadeAnimation(animationAttack3, 0.05f * animationWhirlwind.length); thinkState++; thinkTime = 0.6f; } break; case 12: thinkState++; leftSwipe.FadeOut(0.4f); // Fades both trails out rightSwipe.FadeOut(0.4f); thinkTime = 0.6f; break; case 13: // BACK TO IDLE (for a second) animationController.CrossfadeAnimation(animationIdle, 0.2f); thinkState++; thinkTime = 1f; leftSwipe.ClearTrail(); // Forces both trails to clear rightSwipe.ClearTrail(); break; default: thinkState = 0; break; } } // // ** THIS IS A REALLY TERRIBLE EXAMPLE OF THE CHARACTER MOVING ... (It moves forward when executing a attack) if (thinkState == 3 || thinkState == 7) { transform.position += transform.TransformDirection(Vector3.forward) * t * 3; } else if (thinkState == 11 || thinkState == 10) { transform.position += transform.TransformDirection(Vector3.forward) * t * 0.5f; } // // This rotates the character a based on "facingAngle". It's an experiment to show that the animationController works transform.eulerAngles = new Vector3(transform.eulerAngles.x, Mathf.LerpAngle(transform.eulerAngles.y, facingAngle, 12 * t), transform.eulerAngles.z); }
public void StartTrials() { myTrail.SetTime(2.0f, 0.0f, 1.0f); myTrail.StartTrail(0.5f, 0.4f); }
void Start() { wt = this.GetComponent <WeaponTrail>(); wt.ClearTrail(); wt.StartTrail(.2f, .2f); }
public override void AE_StartAttack() { trail.StartTrail(); wand.StartAttack(); }