Ejemplo n.º 1
0
    public void SetGhost(Vector3 position, GhostType type)
    {
        Ghost   ghost = Instantiate(ghostPrefab, ghostsHolder);
        Vector3 pos   = position;
        Vector2 pos2D = Region.ClosestPoint(position.XZ());

        pos.x = pos2D.x;
        pos.z = pos2D.y;
        ghost.transform.position = pos;
        ghost.type = type;
        if (IsBossMode)
        {
            ghost.Rebirth(3f);
            Add(ghost, fixedGhosts);
        }
        else
        {
            ghost.MoveOut();
            Add(ghost, moveOutGhosts);
        }
    }