Exemplo n.º 1
0
        public IEnumerator RunEvent(GameObject o)
        {
            GameManager.instance.Paused = true;
            Vector3Int newpos;

            if (AEUtilities.PosToInt(o.transform.position) != AEUtilities.PosToInt(transform.position + transform.forward))
            {
                if (locked)
                {
                    StartCoroutine(dialog.PlayEvent(dialogID));
                    yield break;
                }
                else
                {
                    newpos = AEUtilities.PosToInt(transform.position + transform.forward);
                }
            }
            else
            {
                newpos = AEUtilities.PosToInt(transform.position - transform.forward);
            }

            overlay.FadeIn(Color.black, 0.5f);
            yield return(new WaitForSeconds(0.5f));

            o.transform.position = newpos;
            yield return(new WaitForSeconds(0.1f));

            overlay.FadeOut(0.5f);
            yield return(new WaitForSeconds(0.5f));

            locked = false;
            GameManager.instance.Paused = false;
        }