Ejemplo n.º 1
0
    public override IEnumerator NpcExit()
    {
        //transform.position = LevelManager.Instance.orderPosition.position;
        yield return(MoveUtil.MoveOverSeconds(transform.gameObject, LevelManager.Instance.startPosition.position, secondsToMove));

        Destroy(gameObject.gameObject);
    }
Ejemplo n.º 2
0
    public override IEnumerator NpcEnter()
    {
        Vector3 offset     = new Vector3(Random.Range(-0.9f, 0.9f), 0, Random.Range(-0.1f, 0.1f));
        float   timeOffset = Random.Range(0, travelSecondsRandomMax) + extraTravelSecondsPerDifficultyLevel * LevelManager.Instance.settings.difficultyLevel;

        transform.position = LevelManager.Instance.startPosition.position;
        yield return(MoveUtil.MoveOverSeconds(transform.gameObject, LevelManager.Instance.orderPosition.position + offset, travelSeconds + timeOffset));

        ClockTimer clock = (ClockTimer)Instantiate(clockPrefab, transform);

        clock.transform.localPosition = new Vector3(0, 0.6f, 0);
        clock.name         = "clock";
        clock.restart      = false;
        clock.secondsToRun = failureSeconds + failureSecondsPerDifficultyLevel * LevelManager.Instance.settings.difficultyLevel;
        clock.ResetClock();
    }
Ejemplo n.º 3
0
    private IEnumerator ScoreBurger(NpcOrder npc, CompletedBurger burger)
    {
        GameObject tray         = burger.container;
        Transform  trayPosition = npc.trayPosition;

        yield return(MoveUtil.MoveOverSeconds(tray, trayPosition.localPosition, 1f));

        HappinessScoreDisplay scorer = Instantiate <HappinessScoreDisplay>(npc.scorePrefab);

        scorer.transform.SetParent(npc.transform);
        scorer.transform.localPosition    = npc.scorePosition.localPosition;
        scorer.transform.localEulerAngles = npc.scorePosition.localEulerAngles;
        if (scorer != null)
        {
            yield return(scorer.ScoreOrder(npc.GetDesiredIngredients(), burger, npc.GetTimeSinceOrderStarted()));
        }
        Destroy(scorer);
    }
Ejemplo n.º 4
0
    private IEnumerator VendCoroutine(GameObject notifyOnVendComplete)
    {
        currentItem.transform.parent = null;
        yield return(MoveUtil.MoveOverSeconds(currentItem, currentItem.transform.position - (Vector3.forward * 0.1f), 3));

        currentItem.GetComponent <Rigidbody>().detectCollisions = true;
        currentItem.GetComponent <Rigidbody>().isKinematic      = false;
        yield return(new WaitForSeconds(0.1f));

        currentItem.SendMessage("OnVendComplete", SendMessageOptions.DontRequireReceiver);
        yield return(new WaitForSeconds(0.4f));

        InstantiateNewItem();
        vending = false;
        Debug.Log("OnVendComplete being called for " + notifyOnVendComplete, notifyOnVendComplete);
        if (notifyOnVendComplete != null)
        {
            notifyOnVendComplete.SendMessage("OnVendComplete", this);
        }
    }
Ejemplo n.º 5
0
 public override IEnumerator NpcEnter()
 {
     transform.position = LevelManager.Instance.startPosition.position;
     yield return(MoveUtil.MoveOverSeconds(transform.gameObject, LevelManager.Instance.orderPosition.position, 1));
 }
Ejemplo n.º 6
0
    public IEnumerator MoveNpcInAndOrder()
    {
        yield return(MoveUtil.MoveOverSeconds(currentNpc.gameObject, transform.position, 1));

        currentNpc.BuildNewOrder();
    }
Ejemplo n.º 7
0
    public IEnumerator LeaveAndDestroy()
    {
        yield return(MoveUtil.MoveOverSeconds(gameObject, gameObject.transform.position + new Vector3(5, 0, 0), 3));

        Destroy(gameObject);
    }