void Failed(EventInfoS e) { defaultFailGOCycle.negativeGratification = actualCycle.negativeGratification; SetGOCycleByPlace(defaultFailGOCycle, actualPlaceNo); PlayNegativeGratification(); DoCycle(); }
void Destroy(EventInfoS e) { GameManager.eventSystem.Unsubscribe("Success", Destroy); GameManager.eventSystem.Unsubscribe("Failed", Failed); Destroy(gameObject); }
void PlayerDied(EventInfoS e) { state = States.GameOver; endScreen.gameObject.SetActive(true); PlaySound("Dead"); endScreen.text.text = "Your score:\n" + points.ToString(); pointsText.gameObject.SetActive(false); }
void Failed(EventInfoS e) { GameManager.eventSystem.Unsubscribe("Success", Destroy); GameManager.eventSystem.Unsubscribe("Failed", Failed); twirl.center = GameManager.mainCamera.GetComponent <Camera>().WorldToViewportPoint(GameManager.player.GetNextPlacePosition()); GameManager.instance.PlaySound("TimeTravel2"); state = States.Spawn; }
void OnPlayerSuccess(EventInfoS e) { GameManager.eventSystem.Unsubscribe("Succeeded", OnPlayerSuccess); GameManager.eventSystem.Unsubscribe("Failed", OnPlayerFailure); mover.animationFrames = new MovePlayer.SimpleAniStep[1]; mover.animationFrames[0] = new MovePlayer.SimpleAniStep(end, 1, 2f, 0); mover.destroyAtTheEnd = true; mover.Play(); Destroy(gameObject); }
void Die(EventInfoS s) { Debug.Log("I'm Dying"); state = States.Dead; controlAllowed = false; GameObject corpses = Instantiate(leftovers, transform.position, transform.rotation) as GameObject; Destroy(corpses, 5f); Destroy(gameObject); }
void LastBreathe(EventInfoS e) { MovePlayer mover = gameObject.AddComponent <MovePlayer>(); mover.animationFrames = new MovePlayer.SimpleAniStep[2]; mover.animationFrames[0] = new MovePlayer.SimpleAniStep(new Vector3(5.7f, -1f, 0), 1, 2, 0); mover.animationFrames[1] = new MovePlayer.SimpleAniStep(new Vector3(5.7f, -0.8f, 0), 0, 1f, 0); mover.destroyAtTheEnd = true; mover.Play(); }
void OnPlayerFailure(EventInfoS e) { GameManager.eventSystem.Unsubscribe("Succeeded", OnPlayerSuccess); GameManager.eventSystem.Unsubscribe("Failed", OnPlayerFailure); walker.GetComponentInChildren <CapsuleCollider2D>().enabled = true; layerManager.flipX = false; layerManager.name2 = "Queue"; layerManager.SetLayerRecursively(layerManager.gameObject, 8); layerManager.Init(); queue.AddPerson(walker); Destroy(gameObject); }
public bool Call(string eventName, IgorEventSystemS caller) { int index = Array.FindIndex(eventsList, s => eventName == s); if (index >= 0) { EventInfoS e = new EventInfoS(this, caller, index); if (events[index] != null) { events[index](e); } return(true); } return(false); }
void DefaultEvent(EventInfoS e) { Debug.Log("Event sie dzieje: " + eventSystem.eventsList[e.eventId]); }
void StopGenerating(EventInfoS e) { generateCave = false; }
void EmptyPlace(EventInfoS e) { PlayCulmination(); GameManager.player.AllowMovementForTime(actualCycle.spaceBarWaitTime); }
void Succeeded(EventInfoS e) { PlayPositiveGratification(); DoCycle(); }
void StartGenerating(EventInfoS e) { generateCave = true; }
void AllowMovement(EventInfoS e) { offset = gameObject.transform.position - GameManager.player.transform.position; movementAllowed = true; }
void StopMovement(EventInfoS e) { movementAllowed = false; }
void AllowControl(EventInfoS e) { controlAllowed = true; }
void Destroy(EventInfoS e) { Destroy(gameObject); }
void WaitForOccurence(EventInfoS e) { float randWaitingTime = GameManager.instance.RandomRange(MIN_WAITING_TIME, MAX_WAITING_TIME); Invoke("PlayOccurenceAtMyPlace", randWaitingTime); }