protected IGREffectParticles attachEffect(string effid, bool single = true) { IGREffectParticles iGREffectParticles = this.createEffect(effid, single); bool flag = iGREffectParticles != null; if (flag) { GREntity3D gREntity3D = this.m_gr as GREntity3D; bool flag2 = gREntity3D != null; if (!flag2) { DebugTrace.print("attachEffect should be IGRCharacter!"); } } return(iGREffectParticles); }
protected IGREffectParticles attachEffect(string effid, string attachID, bool single = true) { IGREffectParticles eff = createEffect(effid, single); if (eff != null) { IGRCharacter grc = (m_gr as IGRCharacter); if (grc != null) { grc.attachEntity(attachID, eff); } else { DebugTrace.print("attachEffect should be IGRCharacter!"); } } return(eff); }
protected IGREffectParticles attachEffect(string effid, string attachID, bool single = true) { IGREffectParticles iGREffectParticles = this.createEffect(effid, single); bool flag = iGREffectParticles != null; if (flag) { IGRCharacter iGRCharacter = this.m_gr as IGRCharacter; bool flag2 = iGRCharacter != null; if (flag2) { iGRCharacter.attachEntity(attachID, iGREffectParticles); } else { DebugTrace.print("attachEffect should be IGRCharacter!"); } } return(iGREffectParticles); }
public IGREffectParticles createEffect(string effID, float x, float y, bool loop = false) { IGREffectParticles iGREffectParticles = base.createEffect(effID); bool flag = iGREffectParticles == null; IGREffectParticles result; if (flag) { result = null; } else { iGREffectParticles.loop = loop; iGREffectParticles.x = (float)GameTools.inst.pixelToUnit((double)x); iGREffectParticles.z = (float)GameTools.inst.pixelToUnit((double)y); iGREffectParticles.y = this.getZ(x, y); result = iGREffectParticles; } return(result); }
protected IGREffectParticles attachEffect(string effid, bool single = true) { IGREffectParticles eff = createEffect(effid, single); if (eff != null) { GREntity3D grc = (m_gr as GREntity3D); if (grc != null) { //if (grc.rootObj != null && !grc.rootObj.contains(eff.graphObject as IGraphObject3D)) //{ // grc.rootObj.addChild(eff.graphObject as IGraphObject3D); //} } else { DebugTrace.print("attachEffect should be IGRCharacter!"); } } return(eff); }
private void onAddEff(GameEvent e) { Variant d = e.data; string effid = d["effid"]._str; float lx = d["x"]._float; float ly = d["y"]._float; bool loop = false; float angle = 0; if (d.ContainsKey("angle")) { angle = d["angle"]._float; } if (d.ContainsKey("loop")) { loop = d["loop"]._bool; } float z = (float)this.g_mgr.getZ(lx, ly); IGREffectParticles eff = addEffect( effid, (float)GameTools.inst.pixelToUnit(lx), z, (float)GameTools.inst.pixelToUnit(ly), false ); if (eff != null) { if (angle != 0) { eff.rotY = (float)(angle * 180 / Math.PI); } eff.loop = loop; eff.play(); } }
public IGREffectParticles createEffect(string id) { IGREffectParticles iGREffectParticles = this._world.createEntity(Define.GREntityType.EFFECT_PARTICLE, id) as IGREffectParticles; bool flag = id.Length < 20; IGREffectParticles result; string assetPath; if (flag) { Variant effectConf = this.GraphMgr.getEffectConf(id); bool flag2 = effectConf == null; if (flag2) { GameTools.PrintError("createEffect[" + id + "] no conf ERR!"); result = null; return(result); } assetPath = effectConf["file"]._str; } else { assetPath = id; } iGREffectParticles.asset = os.asset.getAsset <IAssetParticles>(assetPath); bool flag3 = iGREffectParticles == null; if (flag3) { GameTools.PrintError("createEffect[" + id + "] ERR!"); result = null; } else { result = iGREffectParticles; } return(result); }