public void InvokeOnDespawn() { if (OnDespawn != null) { OnDespawn.Invoke(); } }
void Despawn() { _player.healthComponent.enabled = false; _graphicsGO.SetActive(false); OnDespawn?.Invoke(); }
void OnTriggerExit2D(Collider2D other) { if (other.CompareTag("SpawnArea")) { OnDespawn?.Invoke(this); } }
private void KillResource() { StopAllCoroutines(); CollectResourceEvent?.Invoke(this, new ResourceV2Args(this)); AddResourceEvent?.Invoke(this, new AddResourceArgs(resource_amount, resource_name)); OnDespawn?.Invoke(this, new ResourceV2Args(this)); Destroy(gameObject); }
public override void Despawn() { if (unconTimer != null && unconTimer.Started) { unconTimer.Stop(); } base.Despawn(); OnDespawn?.Invoke(this); }
public void Despawn() { _spawned = false; _manager.RemoveView(this); if (_updatable.Length > 0 || eventOnUpdate != null) { _server.RemoveFromUpdate(this); } OnDespawn?.Invoke(); }
IEnumerator <float> Die() { state = State.Idle; HP = 0; anim.CrossFadeInFixedTime(CharacterAnimationHelper.Die, 0.3f, 0, 0.6f); yield return(MEC.Timing.WaitForSeconds(settings.AfterDeathTime)); OnDespawn?.Invoke(); yield return(0f); }
public virtual void Despawn() { if (!this.IsSpawned) { return; } WorldInst oldWorld = this.World; BaseInst.Despawn(); OnDespawn?.Invoke(this, oldWorld); }
/// <summary> /// Called every few milliseconds. This function updates the local cache of known entities. /// </summary> public void Update() { _currentManager = Game.Read <IntPtr>(Game.Read <int>(Cataclysm.CurMgrPointer) + Cataclysm.CurMgrOffset, true); _localGUID = Game.Read <ulong>(_currentManager + LocalGUID, true); try { var newEntities = Enumerate().ToDictionary(@object => @object.OBJECT_FIELD_GUID.Value); foreach (var oldEntity in _entities) { if (newEntities.ContainsKey(oldEntity.Key)) { oldEntity.Value.UpdateBaseAddress(newEntities[oldEntity.Key].BaseAddress); OnUpdate?.Invoke(oldEntity.Value); } else { OnDespawn?.Invoke(oldEntity.Value); } } foreach (var newEntity in newEntities) { if (!_entities.ContainsKey(newEntity.Key)) { OnSpawn?.Invoke(newEntity.Value); } } _entities.Clear(); _entities = newEntities; OnUpdateTick?.Invoke(); } catch (Exception e) { Console.WriteLine(e); } }
private void RemoveTower() { OnDespawn?.Invoke(this, new TowerV2RefEventArgs(this)); Destroy(this); }
private void Kill() { OnDespawn?.Invoke(this, new EnemyV2RefEventArgs(this)); Destroy(gameObject); }
protected void CallOnDespawnEvent() { OnPoolReturnRequest.Invoke(this); OnDespawn?.Invoke(this); }
private void OnDespawnMethod() { OnDespawn?.Invoke(gameObject); }
private void RemoveTower() { OnDespawn?.Invoke(this, new TowerV2RefEventArgs(this)); StopAllCoroutines(); Destroy(gameObject); }
public override void Despawn() { pDespawn(); base.Despawn(); OnDespawn?.Invoke(this); }
protected void Despawn() { OnDespawn?.Invoke(); Destroy(gameObject); }
public void Despawn() { OnDespawn?.Invoke(); }
public void Update() { if (_rope != null) { _rope.Update(); if (!_rope.Exists) { var tmpRope = _rope; _rope = null; Retry(); OnDespawn?.Invoke(tmpRope); } return; } if (DateTime.Now > _retry) { if (_tryResolve1) { Entity1 = API.NetToEnt(_netEntity1); if (!API.DoesEntityExist(Entity1)) { Retry(); return; } _tryResolve1 = false; } if (_tryResolve2) { Entity2 = API.NetToEnt(_netEntity2); if (!API.DoesEntityExist(Entity2)) { Retry(); return; } _tryResolve2 = false; } if (Player != Common.PlayerID.ToString()) { GetWorldCoords(out Vector3 pos1, out Vector3 pos2); var playerCoords = API.GetEntityCoords(API.GetPlayerPed(-1), true); const float minDistSquared = NetworkRopeSpawnDistance * NetworkRopeSpawnDistance; if (pos1.DistanceToSquared(playerCoords) > minDistSquared || pos2.DistanceToSquared(playerCoords) > minDistSquared) { Retry(); return; } } try { _rope = new Rope(Player, ID, Entity1, Entity2, Offset1, Offset2, _initialLength); _rope.Length = _length; _showPoolErrMsg = true; } catch (Exception) { if (_showPoolErrMsg) { Debug.WriteLine("[PocceMod] no rope available in pool.. waiting"); _showPoolErrMsg = false; } Retry(); } } }