Exemplo n.º 1
0
    void Start()
    {
        mirah.onReachPortal += () => EndGameSuccessfuly();
        mirah.onDead        += () => EndGameWithFail();
        mirah.InformMapNodes(mapManager.GetPathableNodes());
        mirah.InformEndPortalPosition(mapManager.GetPositionForEndPortal());
        mirah.WalkToTheEndPortal();

        guardian.onDead        += () => EndGameWithFail();
        guardian.onMirahCalled += () =>
        {
            if (Vector3.Distance(guardian.transform.position, mirah.transform.position) < 6)
            {
                mirah.RunToPosition(guardian.Get2DPosition());
            }
        };
    }