// // [ContextMenu("RecordState")] public void RecordState() { // Profiler.BeginSample("effect desc"); if (_hasInit) { // Profiler.EndSample(); return; } _hasInit = true; for (int i = 0; i < ncEffectAniBehaviourList.Count; i++) { NcEffectAniBehaviour ncEAB = ncEffectAniBehaviourList[i]; ncEAB.isReuse = true; ncEAB.RecordStartState(); } for (int i = 0; i < ncDuplicatorList.Count; i++) { NcDuplicator ncd = ncDuplicatorList[i]; ncd.effectObjectDescriptor = this; ncd.isReuse = true; ncd.RecordStartState(); } for (int i = 0; i < ncRotationList.Count; i++) { NcRotation ncR = ncRotationList[i]; ncR.isReuse = true; ncR.RecordStartState(); } for (int i = 0; i < ncRotationList.Count; i++) { NcRotation ncR = ncRotationList[i]; ncR.isReuse = true; ncR.RecordStartState(); } for (int i = 0; i < ncTrailTextureList.Count; i++) { NcTrailTexture ncT = ncTrailTextureList[i]; ncT.isReuse = true; ncT.RecordStartState(); } // Profiler.EndSample(); }
public void setSpeed(float speed) { _speed = speed; for (int i = 0; i < eod.particleSystemList.Count; i++) { ParticleSystem ps = eod.particleSystemList[i]; ps.playbackSpeed *= speed; } for (int k = 0; k < eod.ncEffectAniBehaviourList.Count; k++) { NcEffectAniBehaviour nc = eod.ncEffectAniBehaviourList[k]; nc.OnUpdateEffectSpeed(speed, true); } for (int i = 0; i < eod.ncRotationList.Count; i++) { NcRotation nc = eod.ncRotationList[i]; nc.OnUpdateEffectSpeed(speed, true); } }
// Property ------------------------------------------------------------------------- // Event Function ------------------------------------------------------------------- void OnEnable() { m_Sel = target as NcRotation; m_UndoManager = new FXMakerUndoManager(m_Sel, "NcRotation"); }
//镜面翻转..... // public void setMirrorObject(bool bMirror=false) { // for (int i = 0; i < particleSystemList.Count; i++) // { // ParticleSystem ps = particleSystemList[i]; // if (ps.GetComponent<MirrorEffect>() != null) // { // if (bMirror) // { // Vector3 scale = ps.transform.localScale; // scale.x = -Mathf.Abs(ps.transform.localScale.x); // ps.transform.localScale = scale; // } // else // { // Vector3 scale = ps.transform.localScale; // scale.x = Mathf.Abs(ps.transform.localScale.x); // ps.transform.localScale = scale; // } // } // } // } public void setDisable() { // Profiler.BeginSample("effect disable"); // if (ncDuplicator.Count > 0) // { // particleSystemList = _gameObject.GetComponentsInChildren<ParticleSystem>(true).ToList(); // animationList = _gameObject.GetComponentsInChildren<Animation>(true).ToList(); // //spriteAnimationList = _gameObject.GetComponentsInChildren<SpriteAnimation>(true); // ncCurveAnimationList = _gameObject.GetComponentsInChildren<NcCurveAnimation>(true).ToList(); // ncSpriteAnimationList = _gameObject.GetComponentsInChildren<NcSpriteAnimation>(true).ToList(); // ncUvAnimationList = _gameObject.GetComponentsInChildren<NcUvAnimation>(true).ToList(); // particleSystemRendererList = _gameObject.GetComponentsInChildren<ParticleSystemRenderer>(true).ToList(); // skinnedMeshRendererList = _gameObject.GetComponentsInChildren<SkinnedMeshRenderer>(true).ToList(); // meshRendererList = _gameObject.GetComponentsInChildren<MeshRenderer>(true).ToList(); // ncEffectAniBehaviourList = _gameObject.GetComponentsInChildren<NcEffectAniBehaviour>(true).ToList(); // delayList = _gameObject.GetComponentsInChildren<Delay>(true).ToList(); // } // for (int i = 0; i < particleSystemList.Count; i++) // { // ParticleSystem ps = particleSystemList[i]; // //ps.Stop(); // } if ((_gameObject == null) || (animatorList == null) || (((animatorList.Count > 0) && (animatorList[0] == null)))) { return; } for (int i = 0; i < animatorList.Count; i++) { Animator animator = animatorList[i]; animator.speed = 0; } for (int i = 0; i < animationList.Count; i++) { Animation animation = animationList[i]; animation.Stop(); } for (int i = 0; i < ncEffectAniBehaviourList.Count; i++) { NcEffectAniBehaviour ncEAB = ncEffectAniBehaviourList[i]; if (ncEAB == null) { ncEffectAniBehaviourList.RemoveAt(i); i--; continue; } ncEAB.PauseAnimation(); ncEAB.ResetToStartState(); } for (int i = 0; i < ncDuplicatorList.Count; i++) { NcDuplicator ncd = ncDuplicatorList[i]; ncd.ResetToStartState(); } for (int i = 0; i < ncRotationList.Count; i++) { NcRotation ncR = ncRotationList[i]; ncR.ResetToStartState(); } for (int i = 0; i < ncTrailTextureList.Count; i++) { NcTrailTexture ncT = ncTrailTextureList[i]; ncT.ResetToStartState(); } for (int i = 0; i < cloneObjectList.Count; i++) { GameObject.DestroyImmediate(cloneObjectList[i]); } cloneObjectList.Clear(); _gameObject.transform.localPosition = position; _gameObject.transform.localScale = scale; _gameObject.transform.localRotation = rotation; //resetTransform(); _gameObject.SetActive(false); // Profiler.EndSample(); }
public void play() { for (int i = 0; i < eod.particleSystemList.Count; i++) { ParticleSystem ps = eod.particleSystemList[i]; if (ps != null) { ps.Play(true); } } //foreach (SpriteAnimation sa in spriteAnimationList) //{ // sa.delayIng = true; // sa.loop = false; // sa.enabled = true; // sa.isPaused = false; //} float time = 5000f - (Time.time - oldTime); for (int i = 0; i < eod.ncCurveAnimationList.Count; i++) { NcCurveAnimation nc = eod.ncCurveAnimationList[i]; if (nc.isDelay()) { nc.m_fDelayTime -= time; } else { nc.ResumeAnimation(); } } for (int i = 0; i < eod.ncSpriteAnimationList.Count; i++) { NcSpriteAnimation nc = eod.ncSpriteAnimationList[i]; if (nc.isDelay()) { nc.m_fDelayTime -= time; } else { nc.ResumeAnimation(); } } for (int i = 0; i < eod.ncUvAnimationList.Count; i++) { NcUvAnimation nc = eod.ncUvAnimationList[i]; nc.ResumeAnimation(); } for (int i = 0; i < eod.ncRotationList.Count; i++) { NcRotation nc = eod.ncRotationList[i]; nc.ResumeAnimation(); } for (int i = 0; i < eod.animatorList.Count; i++) { Animator animator = eod.animatorList[i]; animator.speed = 1; } for (int i = 0; i < eod.animationList.Count; i++) { Animation animation = eod.animationList[i]; animation.Play(); } }
public void stop() { for (int i = 0; i < eod.particleSystemList.Count; i++) { ParticleSystem ps = eod.particleSystemList[i]; if (ps != null) { ps.Pause(true); } } //foreach (SpriteAnimation sa in eod.spriteAnimationList) //{ // sa.delayIng = true; // sa.loop = false; // sa.enabled = true; // sa.isPaused = true; //} oldTime = Time.time; for (int i = 0; i < eod.ncCurveAnimationList.Count; i++) { NcCurveAnimation nc = eod.ncCurveAnimationList[i]; if (nc.isDelay()) { nc.m_fDelayTime += 5000f; } else { nc.PauseAnimation(); } } for (int i = 0; i < eod.ncSpriteAnimationList.Count; i++) { NcSpriteAnimation nc = eod.ncSpriteAnimationList[i]; if (nc.isDelay()) { nc.m_fDelayTime += 5000f; } else { nc.PauseAnimation(); } } for (int i = 0; i < eod.ncUvAnimationList.Count; i++) { NcUvAnimation nc = eod.ncUvAnimationList[i]; nc.PauseAnimation(); } for (int i = 0; i < eod.ncRotationList.Count; i++) { NcRotation nc = eod.ncRotationList[i]; nc.PauseAnimation(); } for (int i = 0; i < eod.animatorList.Count; i++) { Animator animator = eod.animatorList[i]; animator.speed = 0; } for (int i = 0; i < eod.animationList.Count; i++) { Animation animation = eod.animationList[i]; animation.Stop(); } }