Example #1
0
    protected override void OnEnable()
    {
        base.OnEnable();

        boards = roar.Leaderboards;

        //Do we need to fetch the list of boards?
        if (whenToFetch == WhenToFetch.OnEnable ||
            (whenToFetch == WhenToFetch.Once && !boards.HasBoardList) ||
            (whenToFetch == WhenToFetch.Occasionally && (whenLastFetched == 0 || Time.realtimeSinceStartup - whenLastFetched >= howOftenToFetch))
            )
        {
            FetchBoardList();
        }
    }
Example #2
0
    /**
     * Called by unity when everything is ready to go.
     * We use this rather than the constructor as its what unity suggests.
     */
    public void Awake()
    {
        config = new Roar.implementation.Config();

        // Apply public settings
        string key = gameKey.ToLower();

        //key = key.Replace("_", "");
        Config.Game = key;

        // Apply changes to API host to Config setting
        string roarUrl = roarAPIUrl.ToLower();

        Config.RoarAPIUrl = roarUrl;

        Config.IsDebug = debug;

        RequestSender api = new RequestSender(config, this, logger);

        webAPI       = new global::WebAPI(api);
        datastore    = new Roar.implementation.DataStore(webAPI, logger);
        friends      = new Roar.implementation.Components.Friends(webAPI.friends, datastore, logger);
        user         = new Roar.implementation.Components.User(webAPI.user, datastore, logger);
        properties   = new Roar.implementation.Components.Properties(datastore);
        leaderboards = new Roar.implementation.Components.Leaderboards(webAPI, datastore, logger);
        inventory    = new Roar.implementation.Components.Inventory(webAPI.items, datastore, logger);
        data         = new Roar.implementation.Components.Data(webAPI.user, datastore, logger);
        shop         = new Roar.implementation.Components.Shop(webAPI.shop, datastore, logger);
        tasks        = new Roar.implementation.Components.Tasks(webAPI.tasks, datastore);
        gifts        = new Roar.implementation.Components.Gifts(webAPI.mail, datastore, logger);
        facebook     = new Roar.implementation.Components.Facebook(webAPI.facebook, datastore, logger);

        if (!Application.isEditor)
        {
            appstore = new Roar.implementation.Components.InAppPurchase(webAPI.appstore, "Roar", logger, appstoreSandbox);
        }

        urbanAirship = new Roar.implementation.Adapters.UrbanAirship(webAPI);

        DontDestroyOnLoad(gameObject);
    }
    void OnEnable()
    {
        boards = roar.Leaderboards;
        mode = Mode.Leaderboards;

        if (whenToFetch == WhenToFetch.OnEnable
        || (whenToFetch == WhenToFetch.Once && !boards.HasDataFromServer)
        || (whenToFetch == WhenToFetch.Occassionally && (whenLastFetched == 0 || Time.realtimeSinceStartup - whenLastFetched >= howOftenToFetch))
        )
        {
            FetchLeaderboards();
        }
    }
    protected override void OnEnable()
    {
        base.OnEnable();

        boards = roar.Leaderboards;

        //Do we need to fetch the list of boards?
        if (whenToFetch == WhenToFetch.OnEnable
        || (whenToFetch == WhenToFetch.Once && !boards.HasBoardList)
        || (whenToFetch == WhenToFetch.Occasionally && (whenLastFetched == 0 || Time.realtimeSinceStartup - whenLastFetched >= howOftenToFetch))
        )
        {
            FetchBoardList();
        }
    }
Example #5
0
    /**
     * Called by unity when everything is ready to go.
     * We use this rather than the constructor as its what unity suggests.
     */
    public void Awake()
    {
        config = new Roar.implementation.Config();

        // Apply public settings
        string key = gameKey.ToLower();
               //key = key.Replace("_", "");
        Config.Game = key;
        Config.IsDebug = debug;

        RequestSender api = new RequestSender(config,this,logger);
        webAPI = new global::WebAPI(api);
        datastore = new Roar.implementation.DataStore(webAPI, logger);
        friends = new Roar.implementation.Components.Friends( webAPI.friends, datastore, logger);
        user = new Roar.implementation.Components.User(webAPI.user,datastore, logger);
        properties = new Roar.implementation.Components.Properties( datastore );
        leaderboards = new Roar.implementation.Components.Leaderboards(webAPI,datastore, logger);
        inventory = new Roar.implementation.Components.Inventory( webAPI.items, datastore, logger);
        data = new Roar.implementation.Components.Data( webAPI.user, datastore, logger);
        shop = new Roar.implementation.Components.Shop( webAPI.shop, datastore, logger );
        tasks = new Roar.implementation.Components.Tasks( webAPI.tasks, datastore );
        facebook = new Roar.implementation.Components.Facebook(webAPI.facebook, datastore, logger);

        if (!Application.isEditor)
        {
            appstore = new Roar.implementation.Components.InAppPurchase( webAPI.appstore, "Roar", logger, appstoreSandbox );
        }

        urbanAirship = new Roar.implementation.Adapters.UrbanAirship(webAPI);

        DontDestroyOnLoad(gameObject);
    }
Example #6
0
    /**
     * Called by unity when everything is ready to go.
     * We use this rather than the constructor as its what unity suggests.
     */
    public void Awake()
    {
        config = new Roar.implementation.Config();

        // Apply public settings
        string key = gameKey.ToLower();
               //key = key.Replace("_", "");
        Config.Game = key;
        Config.IsDebug = debug;

        switch (xmlParser)
        {
        case XMLType.System:
            IXMLNodeFactory.instance = new SystemXMLNodeFactory();
            break;
        case XMLType.Lightweight:
            IXMLNodeFactory.instance = new XMLNodeFactory();
            break;
        }

        RequestSender api = new RequestSender(config,this,logger);
        datastore = new Roar.implementation.DataStore(api, logger);
        webAPI = new global::WebAPI(api);
        user = new Roar.implementation.Components.User(webAPI.user,datastore, logger);
        properties = new Roar.implementation.Components.Properties( datastore );
        leaderboards = new Roar.implementation.Components.Leaderboards(datastore, logger);
        inventory = new Roar.implementation.Components.Inventory( webAPI.items, datastore, logger);
        shop = new Roar.implementation.Components.Shop( webAPI.shop, datastore, logger );
        actions = new Roar.implementation.Components.Actions( webAPI.tasks, datastore );

        if (!Application.isEditor)
        {
            appstore = new Roar.implementation.Components.InAppPurchase( webAPI.appstore, "Roar", logger, appstoreSandbox );
        }

        urbanAirship = new Roar.implementation.Adapters.UrbanAirship(webAPI);

        DontDestroyOnLoad(gameObject);
    }
    protected override void OnEnable()
    {
        base.OnEnable();
        RoarLeaderboardsWidget.OnLeaderboardsFetchedStarted += OnLeaderboardsFetchedStarted;
        RoarLeaderboardsWidget.OnLeaderboardsFetchedComplete += OnLeaderboardsFetchedComplete;
        RoarLeaderboardsWidget.OnLeaderboardSelected += OnLeaderboardSelected;

        boards = roar.Leaderboards;

        FetchIfRequired();
    }