private IEnumerator CoPattern_Sprial() { #if NGUI CNGUITweenRotationSpin pTweenRotate = GetTweenRotate(); Vector3 vecCurrentRotation = transform.rotation.eulerAngles; pTweenRotate.from = vecCurrentRotation; pTweenRotate.to = new Vector3(0f, 0f, vecCurrentRotation.z + 360f); //pTweenRotate.duration = _fTweenDuration; //if (_fAngleRotate > 0f) // pTweenRotate.PlayForward(); //else //{ // pTweenRotate.ResetToFactor(1f); // pTweenRotate.PlayReverse(); //} float fAngleGap = 360 / _iMuzzleCount; float fAngle = 0; while (_bIsGenerating && _iGenerateRemainCount-- > 0) { for (int i = 0; i < _iMuzzleCount; i++) { ProcShotGenerate(transform.position, Quaternion.Euler(transform.rotation.eulerAngles + new Vector3(0f, 0f, fAngle))); fAngle += fAngleGap; } yield return(SCManagerYield.GetWaitForSecond(_fDelaySec_Generate)); } #endif yield return(null); }
private CNGUITweenRotationSpin GetTweenRotate() { CNGUITweenRotationSpin pTweenRotate = GetComponent <CNGUITweenRotationSpin>(); if (pTweenRotate == null) { pTweenRotate = gameObject.AddComponent <CNGUITweenRotationSpin>(); } pTweenRotate.enabled = true; pTweenRotate.ResetToBeginning(); return(pTweenRotate); }
private IEnumerator CoPattern_RotateCircle() { #if NGUI CNGUITweenRotationSpin pTweenRotate = GetTweenRotate(); Vector3 vecCurrentRotation = transform.rotation.eulerAngles; pTweenRotate.from = vecCurrentRotation; pTweenRotate.to = new Vector3(0f, 0f, vecCurrentRotation.z + 360f); //pTweenRotate.duration = _fTweenDuration; EventDelegate pOnFinishPattern = new EventDelegate(ProcSetPatternIsFinish); pOnFinishPattern.oneShot = true; pTweenRotate.AddOnFinished(pOnFinishPattern); pTweenRotate.PlayForward(); #endif yield return(StartCoroutine(CoGenerateSomthing())); }