private void EnumerateResultUI() { var effectObject = this.refEffectObjects[this.effectObjectExecuteId]; Debug.Log( effectObject.name ); var effectData = new EffectData( this.effectSequenceId ); effectObject.BroadcastMessage( ExecuteMessage, effectData, SendMessageOptions.RequireReceiver ); this.receivedEffectTask += effectData.receivedCount; this.effectSequenceId++; Debug.Log( "this.receivedEffectTask = " + this.receivedEffectTask ); if( this.receivedEffectTask == 0 ) { effectObjectExecuteId++; if( this.refEffectObjects.Count == effectObjectExecuteId ) { EndResult(); } else { effectSequenceId = 0; EnumerateResultUI(); } } }
public void AddEffect(string effectName, string effectFile) { var fd = new EffectData { Name = effectName, Filename = effectFile }; m_addedEffects.Add (fd); }
////////////////////////////////////////// /// Effect() ////////////////////////////////////////// public Effect( AppliedEffectData i_data ) { // store a reference to the actual data of this effect m_data = IDL_Effects.GetData( i_data.EffectID ); if ( m_data != null ) { // set the # of turns this effect will last m_nRemainingTurns = m_data.Duration; } else Debug.LogError( "Warning, no effect data for " + i_data.EffectID ); }
////////////////////////////////////////// /// SetState() /// Sets the graphic for the blessing based /// on the incoming state. ////////////////////////////////////////// private void SetState( BlessingStates i_eState, EffectData i_effect ) { m_eState = i_eState; // set the sprite string strSprite = BlessingKey + "_" + i_eState.ToString(); Image.sprite = Resources.Load<Sprite>( strSprite ); // set the alpha string strAlphaKey = "BlessingAlpha_" + i_eState.ToString(); float fAlpha = Constants.GetConstant<float>( strAlphaKey ); Color color = Image.color; color.a = fAlpha; Image.color = color; // update the tooltip UpdateTooltip( i_effect ); }
public override void Enter() { if (World) { Transform p = Carryer.Avatar.GetBindTransform(Bind); Unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, Retain); Unit.CacheTransform.parent = p; Unit.CacheTransform.localPosition = Offset; Unit.CacheTransform.localEulerAngles = Euler; Unit.CacheTransform.parent = null; Unit.CacheTransform.localScale = Scale; Unit.CacheTransform.localEulerAngles = Euler + Carryer.Euler; } else { Transform p = Carryer.Avatar.GetBindTransform(Bind); Unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, GTTransform.Create(Offset, Euler, Scale), p, Retain); } }
public void LoadEffectData() { m_EffectDataDic = new Dictionary <int, EffectData>(); string textAsset = ResourcesManager.Instance.LoadConfigXML("EffectData").text; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(textAsset); XmlNode equipXN = xmlDoc.SelectSingleNode("EffectDatas"); XmlNodeList list = equipXN.ChildNodes; if (list != null && list.Count > 0) { foreach (XmlNode node in list) { XmlElement element = node as XmlElement; if (element.Name.Equals("EffectData")) { EffectData info = new EffectData(); info.ID = CommonHelper.Str2Int(element.GetAttribute("ID")); info.EffectType = CommonHelper.Str2Int(element.GetAttribute("EffectType")); info.ArtRes = element.GetAttribute("ArtRes"); info.Dot = CommonHelper.Str2StringArray(element.GetAttribute("Dot")); info.LiveTime = CommonHelper.Str2Float(element.GetAttribute("LiveTime")); info.Save = CommonHelper.Str2Boolean(element.GetAttribute("Save")); info.Bind = CommonHelper.Str2Boolean(element.GetAttribute("Bind")); info.BindRotate = CommonHelper.Str2Boolean(element.GetAttribute("BindRotate")); info.Speed = CommonHelper.Str2Float(element.GetAttribute("Speed")); info.Radius = CommonHelper.Str2Float(element.GetAttribute("Radius")); info.DestroyOnHit = CommonHelper.Str2Boolean(element.GetAttribute("DestroyOnHit")); info.HitDot = element.GetAttribute("HitDot"); info.Audio = element.GetAttribute("Audio"); if (!m_EffectDataDic.ContainsKey(info.ID)) { m_EffectDataDic.Add(info.ID, info); } } } } }
void SetPanelAttribute(EctypeContainerData ectypeData) { string[] addEffectStr = ectypeData.TrialsAward.Split('|'); Dictionary <int, int> addEffectList = new Dictionary <int, int>(); foreach (var child in addEffectStr) { string[] str = child.Split('+'); EffectData addData = ItemDataManager.Instance.EffectDatas._effects.First(P => P.m_SzName == str[0]); addEffectList.Add(addData.BasePropView, int.Parse(str[1])); } foreach (var child in SingleAtrributeLsit) { int addNumber = 0; addEffectList.TryGetValue(child.EffectBasePropID, out addNumber); addNumber = HeroAttributeScale.GetScaleAttribute(child.EffectBasePropID, addNumber); child.ResetInfo(addNumber.ToString()); } }
// Token: 0x06001D45 RID: 7493 RVA: 0x0008874C File Offset: 0x0008694C public override void Begin() { base.duration = base.distanceToTarget / 30f; EffectData effectData = new EffectData { origin = this.origin, genericFloat = base.duration }; effectData.SetHurtBoxReference(this.target); EffectManager.instance.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/OrbEffects/InfusionOrbEffect"), effectData, true); HurtBox component = this.target.GetComponent <HurtBox>(); CharacterBody characterBody = (component != null) ? component.healthComponent.GetComponent <CharacterBody>() : null; if (characterBody) { this.targetInventory = characterBody.inventory; } }
public Volatile(EffectData status) { /*EventMethods*/ this.eventMethods = status.eventMethods; /*EffectData*/ this.id = status.id; this.name = status.name; this.num = status.num; this.affectsFainted = status.affectsFainted; this.desc = status.desc; this.duration = status.duration; this.drain = status.drain; this.effect = status.effect; this.effectType = status.effectType; this.isZ = status.isZ; this.onBasePowerPriority = status.onBasePowerPriority; this.onBeforeMovePriority = status.onBeforeMovePriority; this.onModifyAccuracyPriority = status.onModifyAccuracyPriority; this.onModifyAtkPriority = status.onModifyAtkPriority; this.onModifyCritRatioPriority = status.onModifyCritRatioPriority; this.onModifyDefPriority = status.onModifyDefPriority; this.onModifyMovePriority = status.onModifyMovePriority; this.onModifyPriorityPriority = status.onModifyPriorityPriority; this.onModifySpAPriority = status.onModifySpAPriority; this.onModifySpDPriority = status.onModifySpDPriority; this.onModifyWeightPriority = status.onModifyWeightPriority; this.onResidualOrder = status.onResidualOrder; this.recoil = status.recoil; this.secondaries = status.secondaries; this.self = status.self; this.shortDesc = status.shortDesc; this.status = status.status; /*Effect*/ this.exists = status.exists; this.time = status.time; linkedSources = new List <BattleElement>(); }
public EffectData SetEffect(string device, string index) { int i; EffectData result; Console.WriteLine("{0}: Setting effect to {1}", device, index); if (int.TryParse(index, out i)) { result = GetEffectManager(device).SelectEffect(i); Console.WriteLine(TankManager.TreadsManager.ActiveEffect.Information.Name); } else { result = new EffectData(new EffectInfo()); Console.WriteLine("{0}: Setting effect to {1} FAILED!", device, index); } return(result); }
// Use this for initialization void Start() { // NONEを引いた値をカウントにする。 var valueCount = Enum.GetValues(typeof(MotionManager.MotionSkillType)).Length - 1; ///<summary> /// データをリストへ入れる ///</summary> for (int i = 0; i < valueCount; i++) { var motionType = (MotionManager.MotionSkillType)i; EffectData data = new EffectData( motionType, speedArray[i], damageArray[i]); dataList.Add(data); } }
private void ProcessGlobalEffect(EffectData effect) { GlobalEffectType type = (GlobalEffectType)effect.Data["Type"]; bool created = (bool)effect.Data["Created"]; int target; float value; switch (type) { case GlobalEffectType.Shield: PlayerManager.Instance.ActivateShieldEffect(effect); break; case GlobalEffectType.HealOverTime: target = (int)effect.Data["Target"]; value = (float)effect.Data["Value"]; if (created) { PlayerManager.Instance.GetPlayerByID(target).HealthPerSecondFromEffect += value; } else { PlayerManager.Instance.GetPlayerByID(target).HealthPerSecondFromEffect -= value; } break; case GlobalEffectType.ManaOverTime: target = (int)effect.Data["Target"]; value = (float)effect.Data["Value"]; if (created) { PlayerManager.Instance.GetPlayerByID(target).ManaPerSecondFromEffects += value; } else { PlayerManager.Instance.GetPlayerByID(target).ManaPerSecondFromEffects -= value; } break; default: throw new ArgumentOutOfRangeException(); } }
/// <summary> /// 特效生成. /// </summary> void GenEffect() { EffectData effectData = m_kEffectGenList[m_nNowIndex]; if (effectData == null) { return; } if (effectData.m_goEffect != null) { GameObject go = Instantiate(effectData.m_goEffect); go.transform.parent = transform; go.name = m_nNowIndex.ToString(); ///< 上編號. UpdateEffectTransformByIndex(m_nNowIndex); UPdateRenderLayerByIndex(m_nNowIndex); } m_nNowIndex++; }
public VisualEffect InstantiateMainEffect([NotNull] Transform parent, [CanBeNull] ITimelineContextProvider contextProvider) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) EffectData mainEffect = m_mainEffect; VisualEffect visualEffect = mainEffect.visualEffect; if (null == visualEffect) { Log.Warning("Tried to instantiate attachable effect named '" + this.get_name() + "' without a visual effect setup.", 163, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\Animations\\AttachableEffect.cs"); return(null); } Vector3 position = parent.get_position() + mainEffect.positionOffset; Quaternion rotation = Quaternion.get_identity(); CameraHandler current = CameraHandler.current; if (null != current) { rotation = current.mapRotation.GetInverseRotation(); } AudioReferenceWithParameters sound = mainEffect.sound; if (sound.get_isValid()) { AudioManager.PlayOneShot(sound, parent); } VisualEffect visualEffect2 = VisualEffectFactory.Instantiate(visualEffect, position, rotation, Vector3.get_one(), parent); visualEffect2.destructionOverride = OnMainEffectInstanceDestructionRequest; return(visualEffect2); }
private static void OnPostprocessEquipment() { string path = System.IO.Path.Combine(RESOURCE_EFFECT_DATA_FOLDER, "EffectID.xml"); TextReader tr = new StreamReader(path); string text = tr.ReadToEnd(); if (text == null) { Debug.LogError("Equipment item file not exist"); return; } else { XmlSpreadSheetReader.ReadSheet(text); XmlSpreadSheet sheet = XmlSpreadSheetReader.Output; string[] keys = XmlSpreadSheetReader.Keys; object[] levelIds = sheet[keys[0]]; List <EffectData> tempList = new List <EffectData>(); for (int i = 2; i < levelIds.Length; i++) { if (0 == i || 1 == i) { continue; } EffectData data = new EffectData(); data.m_SzName = Convert.ToString(sheet["szName"][i]); data.m_IEquipmentID = Convert.ToInt32(sheet["lEquimentID"][i]); data.m_IskillID = Convert.ToInt32(sheet["lSkillID"][i]); data.BaseProp = Convert.ToInt32(sheet["lBaseProp"][i]); data.BasePropView = Convert.ToInt32(sheet["BasePropView"][i]); data.IDS = Convert.ToString(sheet["EffectNameIDS"][i]); data.EffectRes = Convert.ToString(sheet["EffectRes"][i]); data.CombatPara = Convert.ToInt32(sheet["CombatPara"][i]); tempList.Add(data); } CreateMedicamentConfigDataList(tempList); } }
private void FreezeProjectiles(float radiusSqr, Vector3 currentPosition) { Collider[] projectiles = Physics.OverlapSphere(currentPosition, radiusSqr * radiusSqr, LayerIndex.projectile.mask); for (int i = 0; i < projectiles.Length; i++) { ProjectileController projectile = projectiles[i].GetComponent <ProjectileController>(); if (projectile) { TeamComponent projectileTeam = projectile.owner.GetComponent <TeamComponent>(); if (projectileTeam) { if (this.invertTeamFilter) { if (projectileTeam.teamIndex != this.teamFilter.teamIndex) { EffectData effectData = new EffectData(); effectData.origin = projectile.transform.position; effectData.scale = 4; EffectManager.SpawnEffect(Modules.Assets.torporVoidFX, effectData, false); Destroy(projectile.gameObject); } } else { if (projectileTeam.teamIndex == this.teamFilter.teamIndex) { EffectData effectData = new EffectData(); effectData.origin = projectile.transform.position; effectData.scale = 4; EffectManager.SpawnEffect(Modules.Assets.torporVoidFX, effectData, false); Destroy(projectile.gameObject); } } } } } }
public override void WriteBinary(ESPWriter writer) { if (Header != null) { Header.WriteBinary(writer); } if (EffectData != null) { EffectData.WriteBinary(writer); } if (Conditions != null) { foreach (var item in Conditions) { item.WriteBinary(writer); } } if (EntryPointFunctionType != null) { EntryPointFunctionType.WriteBinary(writer); } if (EntryPointFunctionData != null) { EntryPointFunctionData.WriteBinary(writer); } if (ButtonLabel != null) { ButtonLabel.WriteBinary(writer); } if (RunImmediately != null) { RunImmediately.WriteBinary(writer); } if (Script != null) { Script.WriteBinary(writer); } if (EndMarker != null) { EndMarker.WriteBinary(writer); } }
public VisualEffect InstantiateStopEffect([NotNull] Transform parent, [CanBeNull] ITimelineContextProvider contextProvider) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) EffectData stopEffect = m_stopEffect; VisualEffect visualEffect = stopEffect.visualEffect; if (null == visualEffect) { return(null); } Vector3 position = parent.get_position() + stopEffect.positionOffset; Quaternion rotation = Quaternion.get_identity(); CameraHandler current = CameraHandler.current; if (null != current) { rotation = current.mapRotation.GetInverseRotation(); } AudioReferenceWithParameters sound = stopEffect.sound; if (sound.get_isValid()) { AudioManager.PlayOneShot(sound, parent); } VisualEffect visualEffect2 = VisualEffectFactory.Instantiate(visualEffect, position, rotation, Vector3.get_one(), parent); visualEffect2.destructionOverride = OnStopEffectInstanceDestructionRequest; return(visualEffect2); }
public void Dropdown(bool active, ReturnType type = ReturnType.NONE) { dropdown.gameObject.SetActive(active); submitSelectionButton.gameObject.SetActive(active); // set appropriate dropdown options with ReturnType List <string> options; // handling for enums string typeString = type.ToString(); if (typeString.StartsWith("ENUM")) { EnumRepesentation enumRepesentation = EnumRepesentation.EnumLookup(typeString); options = enumRepesentation.getNames().ToList(); } else if (type == ReturnType.ROOT_EFFECT) { options = EffectData.GetAllRootEffects() .Select(effect => effect.name).ToList(); } else { options = EffectData.Effects .Where(effect => effect.returnType == type && effect.type != "primitive") .Select(effect => effect.name).ToList(); } // need to check all ancestors for potential placeholders dropdown.ClearOptions(); if (options.Count > 0) { dropdown.AddOptions(options); } else { dropdown.gameObject.SetActive(false); submitSelectionButton.gameObject.SetActive(false); } }
public void Next() { if (builder == null) { builder = new EffectBuilder(currentCompilerNode); } FieldData nextFieldData = currentCompilerNode.GetNextFieldData(); if (nextFieldData == null) { if (currentCompilerNode.parent == null) { Last(); return; } else { currentCompilerNode = currentCompilerNode.parent; Next(); return; } } currentFieldData = nextFieldData; // handling for auxiliary bytes if (Array.IndexOf(currentFieldData.attributes, "auxiliary") != -1) { string typeString = currentFieldData.returnType.ToString(); Instruction instruction = EffectData.GetEffectDataByName(typeString).instruction; currentCompilerNode.Add( new EffectBuilderItem(new List <byte> { (byte)instruction }) ); Next(); return; } SetState(); }
private static List <Tuple <int, int> > itemOrder(bool finish, RoleData role, ItemData tar, ItemData src = null) { List <Tuple <int, int> > resultSet = new List <Tuple <int, int> >(); if (tar.pickFlag && src == null) { role.handItemID = tar.itemID; int getid = GetItemTableID(tar.itemID); if (getid > 0) { tableList[getid].holdItemID = 0; } resultSet.Add(new Tuple <int, int>(1, 0)); //拾取目标物体声音 playEffect(3); return(resultSet); } int t1 = (src == null) ? 0 : src.typeID; int s1 = (src == null) ? 0 : src.crtStat; int t2 = tar.typeID; int s2 = tar.crtStat; if (itemEffect.ContainsKey(new Tuple <int, int, int, int>(t1, s1, t2, s2))) { EffectData effect = itemEffect[new Tuple <int, int, int, int>(t1, s1, t2, s2)]; if ((effect.holdType == 0) || ((effect.holdType > 0) && effect.holdType == tableList[GetItemTableID(tar.itemID)].typeID)) { if (effect.costTime > 0 && !finish) { resultSet.Add(new Tuple <int, int>(7, effect.costTime)); } else { resultSet.AddRange(runEffect(effect, role, src, tar)); //操作成功 playEffect(5); } } } return(resultSet); }
////////////////////////////////////////// /// GetExample() /// Returns an example of this class, used /// for validating json serialization. ////////////////////////////////////////// public static EffectData GetExample() { EffectData exampleEffect = new EffectData(); exampleEffect.ID = "BLESSING_REGEN"; exampleEffect.Name = "Blessing of Arrun"; exampleEffect.Duration = -1; List<EffectCategories> exampleCategories = new List<EffectCategories>(); exampleCategories.Add( EffectCategories.Blessing ); exampleCategories.Add( EffectCategories.Positive ); exampleEffect.Categories = exampleCategories; List<ModificationData> exampleMods = new List<ModificationData>(); for ( int i = 0; i < 3; ++i ) { ModificationData exampleMod = ModificationData.GetExample(); exampleMods.Add( exampleMod ); } exampleEffect.Modifications = exampleMods; return exampleEffect; }
public override void OnItemDataRefresh(ItemPhysic data) { base.OnItemDataRefresh(data); if (!string.IsNullOrEmpty(idleSound)) { Catalog.LoadAssetAsync <AudioContainer>(idleSound, ac => idleSoundAsset = ac, null); } if (!string.IsNullOrEmpty(startSound)) { Catalog.LoadAssetAsync <AudioContainer>(startSound, ac => startSoundAsset = ac, null); } if (!string.IsNullOrEmpty(stopSound)) { Catalog.LoadAssetAsync <AudioContainer>(stopSound, ac => stopSoundAsset = ac, null); } if (!string.IsNullOrEmpty(whooshFX)) { whoosh = Catalog.GetData <EffectData>(whooshFX, true); } }
public void Save() { moneyManager.SaveSoul(); moneyManager.SaveJewel(); EffectData[] effectDatas = new EffectData[player.effectable.effects.Count]; for (int i = 0; i < effectDatas.Length; i++) { effectDatas[i] = (EffectData)(player.effectable.effects[i].data.Clone()); } PlayerPrefs.SetString("effect", JsonHelper.ToJson <EffectData>(effectDatas)); PlayerPrefs.SetString("stat", Stat.StatToJson(player.data.stat)); boardManager.Save(); PlayerPrefs.SetInt("weapon", player.attackable.weapon.id); SkillManager.instance.Save(); Item.instance.Save(); //Debug.Log("Saved"); }
/// <summary> /// Copies the RagdollJoint data, EffectData from to. /// </summary> public static void CopyRagdollData(Ragdoll _from, Ragdoll to) { IList <RagdollJointData> jointDataList = new List <RagdollJointData> (); foreach (RagdollJointData jointData in _from.RagdollJointDataArray) { RagdollJointData cloned = jointData.GetClone(); jointDataList.Add(cloned); } to.RagdollJointDataArray = jointDataList.ToArray(); IList <EffectData> effectDataList = new List <EffectData> (); foreach (EffectData effectData in _from.EffectData) { EffectData cloned = effectData.GetClone(); effectDataList.Add(cloned); } to.EffectData = effectDataList.ToArray(); }
////////////////////////////////////////// /// SetState() /// Sets the graphic for the blessing based /// on the incoming state. ////////////////////////////////////////// private void SetState(BlessingStates i_eState, EffectData i_effect) { m_eState = i_eState; // set the sprite string strSprite = BlessingKey + "_" + i_eState.ToString(); Image.sprite = Resources.Load <Sprite>(strSprite); // set the alpha string strAlphaKey = "BlessingAlpha_" + i_eState.ToString(); float fAlpha = Constants.GetConstant <float>(strAlphaKey); Color color = Image.color; color.a = fAlpha; Image.color = color; // update the tooltip UpdateTooltip(i_effect); }
public void Init(EffectData data, List <Effect> list, Unit target, Bullet bullet = null, Unit owner = null) { _data = data; EffectSpriteData sprData = GameDatabase.instance.effects[(int)data.type]; name = sprData.name; GetComponent <SpriteRenderer>().sprite = sprData.spr; if (sprData.spr == null) { transform.SetAsLastSibling(); } _owner = owner; _target = target; _bullet = bullet; transform.SetParent(_target.effectable.holder); gameObject.SetActive(true); this.list = list; list.Add(this); OnInit(); }
/// <summary> /// 插入特效 /// </summary> /// <param name="id">FXData id</param> /// <param name="action">加载对象回调</param> public void HandleFx(int id, Transform target = null, System.Action <GameObject, string> action = null, string bone_path = "") { EffectData fxData = EffectData.GetByID(id); if (fxData != null) { if (fxData.effectType == (int)EffectType.Flying) { Shoot(fxData, target); } else { PlayFX(id, fxData, action, bone_path); } } else { Debuger.LogWarning(string.Format("Can not find fxData {0}", id)); } }
// Token: 0x06001D69 RID: 7529 RVA: 0x0007D4C0 File Offset: 0x0007B6C0 public override void Begin() { GameObject effectPrefab = null; if (this.damageOrbType == DamageOrb.DamageOrbType.ClayGooOrb) { this.speed = 5f; effectPrefab = Resources.Load <GameObject>("Prefabs/Effects/OrbEffects/ClayGooOrbEffect"); this.orbDamageType = DamageType.ClayGoo; } base.duration = base.distanceToTarget / this.speed; EffectData effectData = new EffectData { origin = this.origin, genericFloat = base.duration }; effectData.SetHurtBoxReference(this.target); EffectManager.SpawnEffect(effectPrefab, effectData, true); }
private void GroundImpact() { if (!this.hasLanded) { this.hasLanded = true; if (this.swordController && this.swordController.swordActive) { this.FireShockwave(); } Util.PlaySound(Modules.Sounds.GroundImpact, base.gameObject); EffectData effectData = new EffectData(); effectData.origin = base.characterBody.footPosition; effectData.scale = 2f; EffectManager.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/ImpactEffects/ParentSlamEffect"), effectData, true); } }
public override bool LaunchConfiguration() { SimpleEffectDialog dialog = new SimpleEffectDialog(Name, PintaCore.Resources.GetIcon(Icon), Data); // Hookup event handling for live preview. dialog.EffectDataChanged += (o, e) => { if (EffectData != null) { op = new UnaryPixelOps.RedEyeRemove(Data.Tolerance, Data.Saturation); EffectData.FirePropertyChanged(e.PropertyName); } }; int response = dialog.Run(); bool ret = (response == (int)Gtk.ResponseType.Ok); dialog.Destroy(); return(ret); }
/// <summary> /// 发射弓箭或火球等 /// </summary> /// <param name="shootSfxId">飞行物</param> /// <param name="boomSfxId">碰撞后特效,-1代表无</param> /// <param name="target">目标</param> /// <param name="speed">速度</param> /// <param name="distance">如果目标为null时,到前方一定距离后就消失</param> public void Shoot(EffectData fx, Transform target, float speed = 10, float distance = 30) { PlayFX(fx.id, fx, (go, guid) => { //加上bullet脚本,设置参数 var bullet = go.AddComponent <ActorBullet>(); bullet.OnDestroy = () => { RemoveFX(fx.id, guid); }; Vector3 targetPosition = Vector3.zero; if (target == null) { targetPosition = go.transform.position + transform.forward * distance; } bullet.Setup(target, speed, targetPosition); }); }
public override void Begin() { duration = distanceToTarget / 30f; EffectData effectData = new EffectData { origin = origin, genericFloat = duration }; effectData.SetHurtBoxReference(target); EffectManager.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/OrbEffects/DevilOrbEffect"), effectData, true); targetBody = target.healthComponent.body; targetTeam = target.teamIndex; targetTeamManager = new TeamManager(); if (targetBody) { targetInventory = targetBody.inventory; targetHealth = targetBody.healthComponent; } }
////////////////////////////////////////// /// UpdateTooltip() /// Sets the tooltip appropriately based /// on the state of the blessing. ////////////////////////////////////////// private void UpdateTooltip( EffectData i_data ) { TooltipTrigger tooltip = gameObject.GetComponent<TooltipTrigger>(); // set the title to the effect's name tooltip.SetText( "TitleText", i_data.Name ); // the body of the tooltip string strTooltip = StringTableManager.Get( "BLESSING_TOOLTIP" ); // set the active/inactive state string strStateKey = "STATE_" + m_eState.ToString(); string strState = StringTableManager.Get( strStateKey ); strTooltip = DrsStringUtils.Replace( strTooltip, "STATE", strState ); // set the description strTooltip = DrsStringUtils.Replace( strTooltip, "BODY", i_data.CombatDesc ); // everything has been replaced, now set it tooltip.SetText( "BodyText", strTooltip ); }
public GameObject CreateEffect(int id) { EffectData info = DataManager.s_EffectDataManager.GetData(id); if (info == null) { return(null); } GameObject effect = CreateEffect(info.ArtRes, info.Save); if (effect == null) { Debug.LogError("Effect is not exit..." + info.ArtRes); return(null); } effect.SetActive(true); return(effect); }
void Start() { availableEffects = new List <GameObject>(); availableIconSelectors = new List <IconSelector>(); for (int i = 0; i < defaultAvailableEffects.Length; i++) { availableEffects.Add(defaultAvailableEffects[i]); allIconSelectors[i].gameObject.SetActive(true); availableIconSelectors.Add(allIconSelectors[i]); } UpdateAvailableEffects(); activeEffectIndex = 0;//default effect is the first in the list GameObject activeEffect = Instantiate <GameObject>(availableEffects[activeEffectIndex]); activeEffect.transform.parent = transform; activeEffect.transform.localPosition = Vector3.zero; activeEffectData = activeEffect.GetComponent <EffectData>(); activeEffectData.particles.Stop(); }
public EffectData GetClone() { EffectData clone = new EffectData(); clone.Name = this.Name; clone.Count = this.Count; clone.UseGlobalEffect = this.UseGlobalEffect; clone.GlobalType = this.GlobalType; clone.EffectObject = this.EffectObject; clone.DestoryTimeOut = this.DestoryTimeOut; clone.CreateDelay = this.CreateDelay; clone.CreateDelayTime = this.CreateDelayTime; clone.instantiationData = this.instantiationData.GetClone(); clone.InstantionType = this.InstantionType; return clone; }
private void incomingEffectData(EffectData effectdata) { if (effectdata.Name == "DamageBaloon") { GameWorld.GetInstance.newEffect.Add(new DamageBaloon( ResourceManager.GetInstance.Content.Load<Texture2D>(@effectdata.Path), new Vector2(effectdata.PositionX, effectdata.PositionY), effectdata.Value_01)); } else if (effectdata.Name == "AddArrow") { // temporary static sprite (can be changed later in time) Texture2D sprite = ResourceManager.GetInstance.Content.Load<Texture2D>(@"gfx\gameobjects\arrow"); if (effectdata.Value_01 == 1) GameWorld.GetInstance.newEffect.Add(new Arrow( sprite, effectdata.InstanceID, new Vector2(effectdata.PositionX, effectdata.PositionY + sprite.Height * 0.6f), 800, new Vector2(1, 0), Vector2.Zero)); else GameWorld.GetInstance.newEffect.Add(new Arrow( sprite, effectdata.InstanceID ,new Vector2(effectdata.PositionX, effectdata.PositionY + sprite.Height * 0.6f), 800, new Vector2(-1, 0), Vector2.Zero)); } else if (effectdata.Name == "DeleteArrow") { if (GameWorld.GetInstance.listEffect.FindAll(x => x.instanceID == effectdata.InstanceID).Count > 0) { Arrow arrow = GameWorld.GetInstance.listEffect.Find(x => x.instanceID == effectdata.InstanceID) as Arrow; arrow.KeepAliveTimer = 0; } } else if (effectdata.Name == "AddItemSprite") { GameWorld.GetInstance.newEffect.Add(new ItemSprite( new Vector2(effectdata.PositionX, effectdata.PositionY), effectdata.Value_01, effectdata.InstanceID)); } else if (effectdata.Name == "DeleteItemSprite") { if (GameWorld.GetInstance.listEffect.FindAll(x => x.instanceID == effectdata.InstanceID).Count > 0) { ItemSprite item = GameWorld.GetInstance.listEffect.Find(x => x.instanceID == effectdata.InstanceID) as ItemSprite; item.KeepAliveTimer = 0; } } }
// Use this for initialization void Start () { // NONEを引いた値をカウントにする。 var valueCount = Enum.GetValues(typeof(MotionManager.MotionSkillType)).Length - 1; ///<summary> /// データをリストへ入れる ///</summary> for (int i = 0;i < valueCount;i++) { var motionType = (MotionManager.MotionSkillType)i; EffectData data = new EffectData( motionType, speedArray[i], damageArray[i]); dataList.Add(data); } }
IEnumerator _CreateEffect(EffectData effectData) { //Then, wait for the delay if(effectData.CreateDelay) { yield return new WaitForSeconds(effectData.CreateDelayTime); } for(int i=0; i < effectData.Count; i++) { //if effectData is using global setting or create/createAndAttach mode: if (effectData.UseGlobalEffect || (effectData.InstantionType == EffectObjectInstantiation.create || effectData.InstantionType == EffectObjectInstantiation.createAndAttachToAnchor) ) { //decide the position to create the effect object Vector3 instantiationPosition = Vector3.zero; try{ instantiationPosition = effectData.instantiationData.BasicAnchor.position; } catch(System.Exception exc) { Debug.LogError("Have trouble when access base anchor position on effect data:" + effectData.Name); Debug.LogError(exc.StackTrace); } //decide the quaternion to create the effectt object: Quaternion instantiationQuaternion = Quaternion.identity; if(effectData.instantiationData.RandomPositionInsideSphere) { instantiationPosition += Random.insideUnitSphere * effectData.instantiationData.RandomSphereUnit; } instantiationPosition += effectData.instantiationData.WorldOffset; switch(effectData.instantiationData.rotationOfInstance) { case InstantiationRotationMode.IdentityQuaternion: instantiationQuaternion = Quaternion.identity; break; case InstantiationRotationMode.RandomQuaternion: instantiationQuaternion = Random.rotation; break; case InstantiationRotationMode.AlignToAnchor: instantiationQuaternion = effectData.instantiationData.BasicAnchor.rotation; break; case InstantiationRotationMode.SpecifiedQuaternion: instantiationQuaternion = effectData.instantiationData.specifiedQuaterion; break; } Object effectObjectPrototype = effectData.UseGlobalEffect ? Util.RandomFromArray<Object>(Instance.GlobalEffectDataDict[effectData.GlobalType].Effect_Object) : effectData.EffectObject; Object effectObject = Object.Instantiate(effectObjectPrototype, instantiationPosition, instantiationQuaternion); if(effectData.InstantionType == EffectObjectInstantiation.createAndAttachToAnchor) { ((GameObject)effectObject).transform.parent = effectData.instantiationData.BasicAnchor; } float LifeTime = effectData.UseGlobalEffect ? Instance.GlobalEffectDataDict[effectData.GlobalType].EffectLifetime : effectData.DestoryTimeOut; //Destory the effect object after life time, if life time > 0 if(LifeTime > 0) { Destroy(effectObject, LifeTime); } } else if(effectData.InstantionType == EffectObjectInstantiation.play && effectData.EffectObject != null) { GameObject effectObject = effectData.EffectObject; ParticleSystem ps = effectObject.GetComponent<ParticleSystem>(); ps.Play(); } } }
private void LoadEffectData(EffectData effectData) { using (var reader = new BinaryReader(File.Open(effectData.Filename, FileMode.Open, FileAccess.Read))) { m_effects.Add (effectData.Name, new Effect(Game.GraphicsDevice, reader.ReadBytes((int)reader.BaseStream.Length))); } }
/// <summary> /// Creates the effect. /// center: optional, used when using effect type = global type. /// </summary> /// <param name='center'> public static void CreateEffect(EffectData effectData) { Instance.StartCoroutine(Instance._CreateEffect(effectData)); }