Can I Fake Cookies for Debugging in Web Builds?

Self Explanitory....I need to fake some cookies...since my player isn't running on the web, but in the debugger...


Cookies? Are you referring to PlayerPrefs, or do you have another way of storing data? If you are using PlayerPrefs, they should work regardless of being on web or not.

In case you have a data access layer in your project, you can probably fake the cookies if there is a common interface, say ICookie.

class FakeCookie : ICookie
    // getters return fake data from local file or elsewhere

as opposed to

class Cookie : ICookie
    // getters return actual data

and then you can request the correct cookie such that

ICookie cookie = CookieFactory.CreateCookie();
health = cookie.Get("health");

which would do a check something like this

public static ICookie CreateCookie()
   if (Application.isWebPlayer)
        return new Cookie();
        return new FakeCookie();