private void JustPlaySpine(int uid, int templateId, Transform host, string uibase, int depthValue, Action finishCallback, string layer, float xOffset, float yOffset, float xScale, float yScale, bool stencilMask, FXMaskLayer.MaskState maskState = FXMaskLayer.MaskState.None) { FXSpine fXSpine = DataReader <FXSpine> .Get(templateId); if (fXSpine == null || string.IsNullOrEmpty(fXSpine.name)) { return; } if (host == null) { return; } ActorFXSpine actorFXSpine = FXSpinePool.Instance.Get(templateId); if (actorFXSpine == null) { return; } actorFXSpine.get_transform().set_name(templateId.ToString()); if (maskState != FXMaskLayer.MaskState.None) { FXMaskLayer fXMaskLayer = actorFXSpine.get_gameObject().AddUniqueComponent <FXMaskLayer>(); fXMaskLayer.state = maskState; } this.m_fxSpines.set_Item(uid, actorFXSpine); actorFXSpine.get_transform().set_parent(host); actorFXSpine.get_transform().set_localPosition(new Vector3(xOffset, yOffset, 0f)); actorFXSpine.get_transform().set_localRotation(Quaternion.get_identity()); actorFXSpine.get_transform().set_localScale(new Vector3(xScale, yScale, 1f)); LayerSystem.SetGameObjectLayer(actorFXSpine.get_gameObject(), layer, 1); DepthOfFX depthOfFX = actorFXSpine.get_gameObject().AddMissingComponent <DepthOfFX>(); depthOfFX.SortingOrder = depthValue; actorFXSpine._uid = uid; actorFXSpine._dataSpine = fXSpine; actorFXSpine._uibase = uibase; actorFXSpine._depth = depthValue; actorFXSpine._stencilMask = stencilMask; actorFXSpine._finishCallback = finishCallback; actorFXSpine.AwakeSelf(); actorFXSpine.get_gameObject().SetActive(true); actorFXSpine.PlaySpine(); this.DoSetShader(actorFXSpine, stencilMask, fXSpine); this.PlaySound(fXSpine); }
private void JustPlayfxOnUI(int uid, int templateId, Transform host, int time, int depthValue, Action finishCallback = null) { ActorFX actorFX = FXPool.Instance.Get(templateId, false); if (actorFX == null) { return; } Fx fx = DataReader <Fx> .Get(templateId); if (fx == null || string.IsNullOrEmpty(fx.path)) { return; } this.m_fxs.set_Item(uid, actorFX); actorFX.uid = uid; actorFX.AwakeSelf(); actorFX.get_transform().set_parent(host); actorFX.get_transform().set_localPosition(Vector3.get_zero()); actorFX.get_transform().set_localRotation(Quaternion.get_identity()); actorFX.get_gameObject().SetActive(true); actorFX.Scale = 1f; actorFX.finishCallback = finishCallback; SoundManager.PlayUI(fx.audio, false); LayerSystem.SetGameObjectLayer(actorFX.get_gameObject(), "UI", 1); DepthOfFX depthOfFX = actorFX.get_gameObject().AddMissingComponent <DepthOfFX>(); depthOfFX.SortingOrder = depthValue; if (time <= 0) { time = fx.time; } if (time > 0) { actorFX.AutoDestroy = false; actorFX.SetTimer(time); } }