// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { //ParticlesManager.SpawnParticle("tornado3D", spawnPosition.position, true); ParticlesManager.SpawnParticle("hitEffect", spawnPosition.position, true); //GameObject go = Instantiate(particlesPrefab, spawnPosition.position, Quaternion.identity); //go.GetComponent<TornadoBehaviour>().SetFacingRight(true); } //if (Input.GetKeyDown(KeyCode.RightControl)) //{ // ParticlesManager.SpawnParticle("wildboar", spawnPosition.position, true); //} //if (Input.GetKeyDown(KeyCode.Space)) //{ // ParticlesManager.SpawnElfFireBall(spawnPosition.position, target.transform.position - transform.position); //} //if (Input.GetKeyDown(KeyCode.Space)) //{ // ParticlesManager.SpawnParticle("blood", spawnPosition.position, true); //} }
public override void OnStartAttack(int index) { ParticlesManager particlesManager = ParticlesManager.Instance; if (TimeManager.Instance.IsSlowMotionOn) { particlesManager.SlowMotionTrailsManager.RegisterNewSlash(index); } particlesManager.SlashTrailManager.ShootParticle(index); Hashtable parameters = new Hashtable(); WeaponActionType attackType = WeaponActionType.NONE; if (index == 4) { attackType = WeaponActionType.STAB; } else if (index == 3) { attackType = WeaponActionType.UPPERCUT; } else if (index == 5) { attackType = WeaponActionType.DOWNWARD_SMASH; } else { attackType = WeaponActionType.SLASH; } parameters.Add(ParameterType.ATTACK_TYPE, attackType); hitter.Activate(parameters); base.OnStartAttack(index); }
private void ThrowFireBall() { float fbOffsetX = 0.6f; float fbOffsetY = 0.3f; Vector3 iniPos; if (transform.localEulerAngles.y == 180) { iniPos = new Vector3(transform.position.x + fbOffsetX, transform.position.y - fbOffsetY, transform.position.z); } else { iniPos = new Vector3(transform.position.x - fbOffsetX, transform.position.y - fbOffsetY, transform.position.z); } AudioManager.instance.PlayDiegeticFx(gameObject, fireBall, false, 1.0f, AudioManager.FX_DARKELF_FIREBALL_VOL); Vector3 direction; if ((facingRight == true && player.transform.position.x >= iniPos.x) || (facingRight == false && player.transform.position.x <= iniPos.x)) { direction = player.transform.position - iniPos; } else { direction = facingRight ? Vector3.right : Vector3.left; } ParticlesManager.SpawnElfFireBall(iniPos, direction); //ParticlesManager.SpawnElfFireBall(iniPos, player.transform.position - iniPos); }
private void OnDestroy() { if (this == instance) { instance = null; } }
protected override void OnHitWater(Collider water_coll) { base.OnHitWater(water_coll); if (!this.m_CanHitWater) { return; } if (this.m_WasWaterHit) { return; } water_coll.isTrigger = false; int num = Physics.RaycastNonAlloc(CameraManager.Get().m_MainCamera.transform.position, CameraManager.Get().m_MainCamera.transform.forward, this.m_RaycastResultsTmp, 5f); for (int i = 0; i < num; i++) { if (this.m_RaycastResultsTmp[i].collider.gameObject == water_coll.gameObject) { ParticlesManager.Get().Spawn("SmallSplash_Size_C", this.m_RaycastResultsTmp[i].point - CameraManager.Get().m_MainCamera.transform.forward * 0.2f, Quaternion.identity, Vector3.zero, null, -1f, false); this.m_WasWaterHit = true; break; } } water_coll.isTrigger = true; }
void OnEnable() { processing = true; currentColor = renderer.color; StartCoroutine("CustomUpdate"); ParticlesManager.AddParticle(this); }
public override void OnAnimEvent(AnimEventID id) { if (id == AnimEventID.SpawnWashingLHandFX) { Transform lhand = Player.Get().GetLHand(); this.m_LHandParticle = ParticlesManager.Get().Spawn("fx_washing_player", lhand.position, Quaternion.identity, Vector3.zero, null, -1f, false); return; } if (id == AnimEventID.SpawnWashingRHandFX) { Transform rhand = Player.Get().GetRHand(); this.m_RHandParticle = ParticlesManager.Get().Spawn("fx_washing_player", rhand.position, Quaternion.identity, Vector3.zero, null, -1f, false); return; } if (id == AnimEventID.DestroyWashingLHandFX) { ParticlesManager.Get().Remove(this.m_LHandParticle); this.m_LHandParticle = null; return; } if (id == AnimEventID.DestroyWashingRHandFX) { ParticlesManager.Get().Remove(this.m_RHandParticle); this.m_RHandParticle = null; } }
private void Start() { ParticlesManager.Get().Spawn("Blood Effect", this.m_HitPos, Quaternion.identity, Vector3.zero, null, -1f, false); this.m_Item.StaticPhxRequestAdd(); this.m_Item.UpdatePhx(); this.m_BoxCollider = base.gameObject.GetComponent <BoxCollider>(); if (this.m_KillItem) { this.m_KillItem.StaticPhxRequestAdd(); this.m_KillItem.UpdatePhx(); base.transform.rotation = this.m_KillItem.m_DamagerStart.rotation; if (this.m_ID == AI.AIID.Arowana) { base.transform.Rotate(Vector3.forward, -60f); } else if (this.m_ID == AI.AIID.Piranha) { base.transform.Rotate(Vector3.forward, -90f); } else if (this.m_ID == AI.AIID.Stingray) { base.transform.Rotate(Vector3.forward, -210f); } else { base.transform.Rotate(Vector3.forward, 0f); } base.transform.parent = this.m_KillItem.transform; this.m_LocalRot = base.transform.localRotation; base.transform.parent = null; Vector3 b = (this.m_KillItem.m_DamagerStart.position - this.m_KillItem.m_DamagerEnd.position).normalized * -0.07f; base.transform.position = this.m_KillItem.m_DamagerStart.position + b; } this.m_WaterBoxCollider = this.m_Tank.GetComponent <BoxCollider>(); }
private void SpawnBlood(DamageInfo info) { if (AI.IsTurtle(this.m_AI.m_ID) || this.m_AI.m_ID == AI.AIID.ArmadilloThreeBanded) { return; } AIManager.BloodFXType key = info.m_DamageItem ? info.m_DamageItem.m_Info.m_BloodFXType : AIManager.BloodFXType.Blunt; List <string> list = AIManager.Get().m_BloodFXNames[(int)key]; if (list.Count == 0) { DebugUtils.Assert("Missing blood fxes!", true, DebugUtils.AssertType.Info); return; } string text = list[UnityEngine.Random.Range(0, list.Count)]; text += ((this.m_AI.m_Params.m_Human || this.m_AI.m_Params.m_BigAnimal) ? "_M" : "_S"); Vector3 vector = Vector3.zero; RagdollBone closestRagdollBone = this.m_AI.GetClosestRagdollBone(info.m_Position); if (closestRagdollBone) { vector = closestRagdollBone.transform.position; } else { vector = base.transform.position; } Vector3 forward = (info.m_Damager && info.m_Damager.IsPlayer()) ? (Camera.main.transform.position - Camera.main.transform.right - vector).normalized : (-info.m_HitDir); ParticlesManager.Get().Spawn(text, vector, Quaternion.LookRotation(forward), Vector3.zero, null, -1f, false); }
private void DelayedSpawnFX() { Vector3 fxToSpawnPos = this.m_FxToSpawnPos; ParticlesManager.Get().Spawn(this.m_FXToSpawn, fxToSpawnPos, Quaternion.identity, Vector3.zero, null, -1f, false); this.m_SpawnFX = false; }
public override void OnAnimEvent(AnimEventID id) { if (id == AnimEventID.HarvestingEnd) { this.m_AnimLoops++; if (this.m_AnimLoops == Skill.Get <HarvestingAnimalsSkill>().GetAnimationsCount()) { this.m_Animator.SetTrigger(this.m_HarvestingFinishHash); return; } } else { if (id == AnimEventID.HarvestingFinishEnd) { this.m_Animator.SetTrigger(this.m_HarvestingAnimalEndHash); this.m_End = true; return; } if (id == AnimEventID.HarvestingSpawnFX) { ParticlesManager.Get().Spawn("Animal Harvest", Camera.main.transform.position + Camera.main.transform.forward * 0.1f + Vector3.down * 0.5f, Player.Get().transform.rotation, Vector3.zero, null, -1f, false); } } }
public override bool TakeDamage(DamageInfo info) { base.TakeDamage(info); ParticlesManager.Get().Spawn("Blood_Effect_Big", base.transform.position, Quaternion.identity, Vector3.zero, null, -1f, false); UnityEngine.Object.Destroy(base.gameObject, 0.2f); return(true); }
private void UpdateParticlesSpawn() { float num = 1f - this.m_Curve.Evaluate((Time.time - this.m_StartTime) / this.m_Duration); float num2 = this.m_VerticesMinY + num * (this.m_VerticesMaxY - this.m_VerticesMinY); for (int i = 0; i < this.m_ParticleSpawnPos.Count; i++) { MiaDisappearEffectController.MiaDisappearEffectParticleSpawnPoint miaDisappearEffectParticleSpawnPoint = this.m_ParticleSpawnPos[i]; if (!miaDisappearEffectParticleSpawnPoint.m_AlreadySpawned && miaDisappearEffectParticleSpawnPoint.m_Pos.y >= num2) { miaDisappearEffectParticleSpawnPoint.m_AlreadySpawned = true; GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.m_Prefab, miaDisappearEffectParticleSpawnPoint.m_Pos, Quaternion.identity); ParticlesManager.Get().Spawn(gameObject, miaDisappearEffectParticleSpawnPoint.m_Pos, Quaternion.identity, Vector3.zero, null, -1f, false); ParticleSystem.ColorOverLifetimeModule colorOverLifetime = gameObject.GetComponent <ParticleSystem>().colorOverLifetime; ParticleSystem.MinMaxGradient color = colorOverLifetime.color; if (color.gradient != null) { GradientColorKey[] array = new GradientColorKey[2]; GradientAlphaKey[] array2 = new GradientAlphaKey[2]; array[0].color = miaDisappearEffectParticleSpawnPoint.m_Color; array[0].time = 0f; array[1].color = miaDisappearEffectParticleSpawnPoint.m_Color; array[1].time = 1f; array2[0].alpha = 1f; array2[0].time = 0f; array2[1].alpha = 0f; array2[1].time = 1f; color.gradient.SetKeys(array, array2); } colorOverLifetime.color = color; } } }
public virtual void Init(RigManager rigManager, BurinkeruCharacterController characterController, ParticlesManager particleManager) { this.rigManager = rigManager; this.characterController = characterController; this.particleManager = particleManager; CanAttack = true; initActionsDefinitions(); }
private void OnTriggerEnter(Collider other) { var m = other.GetComponentInParent<Mushroom>(); if (m != null && canKill) { ParticlesManager.Explode(m.transform.position); Destroy(m.gameObject); } }
private void OnEnterState() { this.m_EnterStateTime = Time.time; switch (this.m_Animator.GetInteger(this.m_StateHash)) { case 0: this.DestroyFish(); this.m_FishingRod.Break(); return; case 1: this.BlockMoves(false); this.BlockRotation(false); return; case 2: case 3: case 4: case 10: case 11: break; case 5: this.BlockMoves(true); this.m_Player.StartAim(Player.AimType.Fishing, 18f); return; case 6: this.m_FishingRod.StartCast(); PlayerConditionModule.Get().DecreaseStamina(PlayerConditionModule.Get().GetStaminaDecrease(StaminaDecreaseReason.RodCast)); return; case 7: HintsManager.Get().ShowHint("Catch_Fish", 10f); this.m_FishingRod.StartFishing(this.m_Target); ParticlesManager.Get().Spawn("SmallSplash_Size_C", this.m_Target, Quaternion.identity, Vector3.zero, null, -1f, false); return; case 8: PlayerConditionModule.Get().DecreaseStamina(PlayerConditionModule.Get().GetStaminaDecrease(StaminaDecreaseReason.RodReel)); return; case 9: PlayerConditionModule.Get().DecreaseStamina(PlayerConditionModule.Get().GetStaminaDecrease(StaminaDecreaseReason.RodStrike)); break; case 12: this.ShowFish(); this.BlockRotation(true); return; default: return; } }
public void Hit() { SoundManager.PlayHit(); anim.SetTrigger(hitTrig); if (--health == 0) { GameManager.AddPoints(initHealth); ParticlesManager.Explode(transform.position); Destroy(gameObject); } }
void GetParticles() { if (transform == null) { return; } starPosition = transform.position; usedParticles = ParticlesManager.GetAllParticlesInRadius(starPosition, gravityConfiguration.gravityRadius); calculate = true; }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
private void Awake() { if (instance != null) { Debug.Log("Nie moga istniec dwie instancje ParticlesManager na scenie"); } else { instance = this; } }
private void Start() { audio_manager = AudioManager.instance; // Кэшируем скрипт particles_manager = ParticlesManager.instance; // Кэшируем скрипт cam_shake = CameraShake.instance; rb = GetComponent <Rigidbody2D>(); PrepareBasicStats(); // Устанавливаем базовые статы юнита CalculateStats(); // Пересчитываем статы clip = audio_s.clip; }
public void SpawnFX() { Transform transform = this.m_Player.gameObject.transform.FindDeepChild("mixamorig:Head"); Vector3 pos = transform.position + transform.TransformDirection(this.m_ParticlePosShift); ParticlesManager.Get().Spawn("Vomit", pos, transform.rotation, transform); this.m_FXCounter++; if (this.m_FXCounter < 10) { base.Invoke("SpawnFX", 0.1f); } }
private void Awake() { instance = this; tileDestructionParticles = new ParticleSystem[QUANTITY_IN_POOL]; for (int i = 0; i < QUANTITY_IN_POOL; i++) { GameObject particleObject = Instantiate(tileDestructionParticlePrefab); particleObject.transform.parent = tileDestructionParticlesHolder; particleObject.transform.localPosition = Vector3.zero; tileDestructionParticles[i] = particleObject.GetComponent<ParticleSystem>(); } }
// Start is called before the first frame update void Start() { player = FindObjectOfType <PlayerData>(); _instance = this; PM = FindObjectOfType <ParticlesManager>(); CM = FindObjectOfType <CoinsManager>(); CheckCharacters(); CheckButtons(); SetQtnCurrency(); }
public void ApplyDamage(int dmg = 0) { ParticlesManager.SpawnParticle("hitEffect", transform.position, true); GameObject broken = Instantiate(remains, transform.position, transform.rotation); broken.GetComponent <AdjustDirection>().fragmentScale = transform.localScale; broken.GetComponent <AdjustDirection>().pushForceX = pushForceX; broken.GetComponent <AdjustDirection>().pushForceY = pushForceY; AudioManager.instance.PlayDiegeticFx(gameObject, destructionSound, false, 1.0f, AudioManager.FX_DESTRUCTION_VOL); GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraFollow>().StartShake(magnitude, duration); Destroy(gameObject); }
void Awake() { if (particlesManager != null) { Destroy(this); } else { particlesManager = this; particlesPool = new Dictionary <string, List <GameObject> >(); particlesManager.transform.position = Vector3.zero; } }
private void DestroyWashParticles() { if (this.m_LHandParticle) { ParticlesManager.Get().Remove(this.m_LHandParticle); this.m_LHandParticle = null; } if (this.m_RHandParticle) { ParticlesManager.Get().Remove(this.m_RHandParticle); this.m_RHandParticle = null; } }
// when attacking the chest it gets open public void ApplyDamage(int dmg = 0) { ParticlesManager.SpawnParticle("hitEffect", transform.position, true); if (currentState == state.CLOSED) { if (openChest) { AudioManager.instance.PlayDiegeticFx(gameObject, openChest, false, 1.0f, AudioManager.FX_OPEN_CHEST_VOL); } currentState = state.OPEN; chestAnimator.SetBool("open", true); } }
private void UpdateBodyFXs() { if (Time.time - this.m_BodyFXSpawnLastTime > this.m_BodyFXSpawnCooldown) { Vector3 position = this.m_Player.GetSpine1().position; float y = this.m_Player.GetWaterLevel() + 0.01f; float y2 = this.m_Player.GetWaterLevel() + 0.02f; position.y = y; ParticlesManager.Get().Spawn("water_splashes_foam_player", position, Quaternion.identity, this.m_WantedSpeed, this.m_Player.transform, 1f, true); position.y = y2; ParticlesManager.Get().Spawn("water_waves_lux_projector", position, Quaternion.identity, this.m_WantedSpeed, this.m_Player.transform, 1f, true); this.m_BodyFXSpawnLastTime = Time.time; } }
private void SpawnSwimHandFXs() { Vector3 position = this.m_Player.GetLHand().position; float y = this.m_Player.GetWaterLevel() + 0.01f; float y2 = this.m_Player.GetWaterLevel() + 0.02f; position.y = y; ParticlesManager.Get().Spawn("water_splashes_foam_player_hand", position, Quaternion.identity, this.m_WantedSpeed, this.m_Player.transform, 1f, true); position.y = y2; ParticlesManager.Get().Spawn("water_splashes_player_hand_a", position, Quaternion.identity, this.m_WantedSpeed, this.m_Player.transform, 1f, true); position = this.m_Player.GetRHand().position; position.y = y; ParticlesManager.Get().Spawn("water_splashes_foam_player_hand", position, Quaternion.identity, this.m_WantedSpeed, this.m_Player.transform, 1f, true); position.y = y2; ParticlesManager.Get().Spawn("water_splashes_player_hand_a", position, Quaternion.identity, this.m_WantedSpeed, this.m_Player.transform, 1f, true); }
public override void OnAnimEvent(AnimEventID id) { base.OnAnimEvent(id); if (id == AnimEventID.MakeFireSuccessEnd) { if (this.m_State == MakeFireController.State.Success && this.m_Fire != null) { this.m_FireTool.m_KindlingSlot.RemoveItem(); Item tool = this.m_Tool; this.m_Player.DropItem(tool); InventoryBackpack.Get().InsertItem(tool, null, null, true, true, true, true, true); this.m_Player.ResetControllerToStart(); this.m_Player.SetWantedItem(Hand.Right, this.m_Fire, true); this.m_Fire.m_ConnectedParticleObj = ParticlesManager.Get().Spawn("Small Smoke - Ember", this.m_Fire.transform.position, Quaternion.identity, Vector3.zero, this.m_Fire.transform, -1f, false); this.m_Fire = null; return; } } else if (id == AnimEventID.MakeFireFailEnd) { if (this.m_State == MakeFireController.State.Fail || this.m_State == MakeFireController.State.Quit) { if (this.m_FireTool != null) { this.m_FireTool.m_KindlingSlot.RemoveItem(); Item tool2 = this.m_Tool; this.m_Player.DropItem(tool2); InventoryBackpack.Get().InsertItem(tool2, null, null, true, true, true, true, true); } this.m_Player.SetWantedItem(Hand.Right, null, true); if (this.m_Kindling != null) { this.m_Kindling.enabled = true; InventoryBackpack.Get().InsertItem(this.m_Kindling, null, null, true, true, true, true, true); this.m_Kindling = null; return; } } } else if (id == AnimEventID.MakeFireTakeFire && this.m_State == MakeFireController.State.Success && !this.m_Fire) { this.m_Fire = ItemsManager.Get().CreateItem(ItemID.Fire, false, Vector3.zero, Quaternion.identity); this.m_Player.AttachItemToHand(Hand.Right, this.m_Fire); UnityEngine.Object.Destroy(this.m_Kindling.gameObject); this.m_Kindling = null; } }
void Awake() { Instance = this; }