public static void SetActiveState(string name) { //Debug.Log("Changing state to: " + name); SEventSystem.FireEvent(EventIDs.Lifecycle.StateChange, new PMEventArgs(name)); currentState = name; int i = 0; foreach (Pieka pieka in piekas) { if (i >= piekasArray.Count) { piekasArray.Add(pieka); } else { piekasArray [i] = pieka; } i++; } for (i--; i >= 0; i--) { ((Pieka)piekasArray [i]).OnStateChange(name); } }
void OnJointBreak2D(Joint2D brokenJoint) { if (brokenJoint is FixedJoint2D) { SEventSystem.FireEvent(EventNames.CAR_BRAKE); SEventSystem.FireEvent(EventNames.CAR_BRAKE_WITH_VELOCITY, new PMEventArgs(velocityInPrevFrame)); } }
public void OnPointerClick(PointerEventData eventData) { if (Event != null) { SEventSystem.FireEvent(Event.Event); } if (onClick != null) { onClick(); } }
private void rotateAndbroadcast() { rotate(); if (onIsPressed != null) { onIsPressed(Value); } if (Event != null) { SEventSystem.FireEvent(Event.Event, new PMEventArgs(Value)); } }
protected void RegisterAll() { foreach (PairEventString e in events) { SEventSystem.Register(e.Name, e.Event); } foreach (PairEventLiteString e in eventsLite) { SEventSystem.Register(e.Name, e.Event); } }
public void Reset() { foreach (var resetable in resetables) { resetable.Reset(); } if (Event != null) { SEventSystem.FireEvent(Event.Event); } }
private void toggle() { state = !state; if (onToggle != null) { onToggle(); } if (state && OnEvent != null) { SEventSystem.FireEvent(OnEvent.Event); } if (!state && OffEvent != null) { SEventSystem.FireEvent(OffEvent.Event); } setColor(state); }
void Awake() { var levelData = Piekson.FromJson <LevelDto>(Level.Json); spawnSprites(levelData); spawnSpriteShapes(levelData); var carWasSpawned = spawnPrefabs(levelData); if (carWasSpawned) { SEventSystem.FireEvent(EventNames.LEVEL_INSTANTIATED); } else { Debug.Log("Car was not instantiated!"); } }
private void handleBurn(Collider2D wheelCollider, SpriteRenderer spriteRenderer, BurnInfo.WhichWheelEnum whichWheel, BurnInfo.DirectionEnum direction, float wheelKmPerH, float velocityInKmPerH, ContactPoint2D[] burnContacts, PiekaMaterial piekaMaterial) { if (wheelCollider.IsTouchingLayers(Consts.FloorLayerMask)) { var carSpeedPlusAcceptableDifference = velocityInKmPerH + AcceptableSpeedDifference; var wheelSpeed = wheelKmPerH; if (wheelSpeed > carSpeedPlusAcceptableDifference) { var filter = new ContactFilter2D(); filter.layerMask = Consts.FloorLayerMask; var numberOfContacts = wheelCollider.GetContacts(filter, burnContacts); for (int i = 0; i < numberOfContacts; i++) { SEventSystem.FireEvent(EventNames.TEST); var gameObject = burnContacts[i].collider.gameObject; var point = burnContacts[i].point; var power = Mathf.Clamp((wheelSpeed - carSpeedPlusAcceptableDifference) / BurnSpeedRange, 0, 1); var burnInfo = new BurnInfo(whichWheel, direction, point, power, gameObject, piekaMaterial); SEventSystem.FireEvent(EventNames.WHEEL_BURN, new PMEventArgs(burnInfo)); } } } }
void fireEvent() { SEventSystem.FireEvent(eventId); }
private void Start() { SEventSystem.FireEvent(EventNames.LEVEL_INSTANTIATED); }
protected void FireEvent(string id, PMEventArgs args) { SEventSystem.FireEvent(id, args); }
protected void FireEvent(string id) { SEventSystem.FireEvent(id); }