Ejemplo n.º 1
0
 void Failed(EventInfoS e)
 {
     defaultFailGOCycle.negativeGratification = actualCycle.negativeGratification;
     SetGOCycleByPlace(defaultFailGOCycle, actualPlaceNo);
     PlayNegativeGratification();
     DoCycle();
 }
Ejemplo n.º 2
0
    void Destroy(EventInfoS e)
    {
        GameManager.eventSystem.Unsubscribe("Success", Destroy);
        GameManager.eventSystem.Unsubscribe("Failed", Failed);

        Destroy(gameObject);
    }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
    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;
    }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
    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);
    }
Ejemplo n.º 7
0
    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();
    }
Ejemplo n.º 8
0
 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);
 }
Ejemplo n.º 9
0
    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);
    }
Ejemplo n.º 10
0
 void DefaultEvent(EventInfoS e)
 {
     Debug.Log("Event sie dzieje: " + eventSystem.eventsList[e.eventId]);
 }
Ejemplo n.º 11
0
 void StopGenerating(EventInfoS e)
 {
     generateCave = false;
 }
Ejemplo n.º 12
0
 void EmptyPlace(EventInfoS e)
 {
     PlayCulmination();
     GameManager.player.AllowMovementForTime(actualCycle.spaceBarWaitTime);
 }
Ejemplo n.º 13
0
 void Succeeded(EventInfoS e)
 {
     PlayPositiveGratification();
     DoCycle();
 }
Ejemplo n.º 14
0
 void StartGenerating(EventInfoS e)
 {
     generateCave = true;
 }
Ejemplo n.º 15
0
 void AllowMovement(EventInfoS e)
 {
     offset          = gameObject.transform.position - GameManager.player.transform.position;
     movementAllowed = true;
 }
Ejemplo n.º 16
0
 void StopMovement(EventInfoS e)
 {
     movementAllowed = false;
 }
Ejemplo n.º 17
0
 void AllowControl(EventInfoS e)
 {
     controlAllowed = true;
 }
Ejemplo n.º 18
0
 void Destroy(EventInfoS e)
 {
     Destroy(gameObject);
 }
Ejemplo n.º 19
0
    void WaitForOccurence(EventInfoS e)
    {
        float randWaitingTime = GameManager.instance.RandomRange(MIN_WAITING_TIME, MAX_WAITING_TIME);

        Invoke("PlayOccurenceAtMyPlace", randWaitingTime);
    }