Question by
AlexStf · Apr 01, 2017 at 07:48 PM ·
c#unity 5scripting problemscripting beginnerbegginer
Dreamlo Leaderbord issue
Hi, can someone Please help me implement the dreamlo leaderboard into a flappy bird like game ? I'm really new with code and unity and i'm trying for days and can't get it to work.I'm trying to get the score and username that are on 2 different scripts into the Dreamlo Highscore script.(They are also in different scenes,and refer to different gameobjects, so can't move them.)
Thank you !
using UnityEngine;
using System.Collections;
public class Highscores : MonoBehaviour {
const string privateCode = "";
const string publicCode = "";
const string webURL = "http://dreamlo.com/lb/";
DisplayHighscores highscoreDisplay;
public Highscore[] highscoresList;
static Highscores instance;
int score;
string username;
void Awake() {
int score = GetComponent<GController> ().score;
string username = GetComponent<InputName>().username;
AddNewHighscore (username, score);
highscoreDisplay = GetComponent<DisplayHighscores> ();
instance = this;
}
// rest of code
Comment