Skip to content

Instantly share code, notes, and snippets.

@Eugeny
Created November 19, 2012 11:32
Show Gist options
  • Save Eugeny/4110222 to your computer and use it in GitHub Desktop.
Save Eugeny/4110222 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
using System.IO;
#if UNITY_ANDROID
using FacebookAccess = FacebookAndroid;
#elif UNITY_IPHONE
using FacebookAccess = FacebookBinding;
#endif
public class Global : MonoBehaviour
{
private bool sendInfo=false;
public TextAsset Textass1,Textass2,Textass3;
private double time1;
private static string[] permissions= new string[] {""};
private string parameters = "{ \"q\" : \"facebook\"}";
private string state = "";
public static bool BUYMONEY=false;
public static bool DownloadDONE=false;
public string facebookID;
private bool facebooklogin=false;
string test;
public static AudioSource SoundS;
public static bool UPDATE=false;
public static string facebookToken="2";
public static string facebookUserID="2";
public static float NrLevel=0;
public static float NrLevelMax=-1;
public static float Level;
public static Texture2D TLevel;
public static int r=1;
public static int buyCoin1,buyCoin2,buyCoin3,buyCoin4,buyCoin5,buyCoin6;
public static int MONEYBUY=123;
/*
* 1-free spin- la 3 pe ecran
* 2-mini game- 10 ++
* 3-orice alt simbol
* 4-simbol 1
* 5-simbol 2
* 6-simbol 3
* 7-simbol 4
* 8-simbol 5
* 9-simbol 6
* 10-simbol 7
* 11-simbol 8
* 12-simbol
*/
private string DataStart="500@0@1@10@1#2#3#4#5#6#7#8#9#10@11@1#2#3#4#5#6#7#8#9#10#11@12@1#2#3#4#5#6#7#8#9#10#11#12@13@1#2#3#4#5#6#7#8#9#10#11#12#1@14@1#2#3#4#5#6#7#8#9#10#11#12#1#2@1#2#3#4#5#6#7#8#9#10#20#30#40#50@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@3#4#5@5#10#20@1@1000@1000@200@1000@1000@200@@";
public static float money=102;
public static float SpinNR=0;
public static int[] B1;//= {11,12,3,4,5,6,7,8,9,10, 11, 12, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4};
public static int[] B2;//= {11,12,3,4,5,6,7,8,9,10, 11, 12, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4};
public static int[] B3;//= {11,12,3,4,5,6,7,8,9,10, 11, 12, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4};
public static int[] B4;//= {11,12,3,4,5,6,7,8,9,10, 11, 12, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4};
public static int[] B5;//= {11,12,3,4,5,6,7,8,9,10, 11, 12, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4};
public static int[] BxNR={32,32,32,32,32}; //count B1,B2,B3,B4,B5;
public static float nr2=0.1F,nr3=0.2F,nr4=0.3F,nr5=0.4F;
public static int[] NRFspinToken={3,4,5};
public static int[] NRFspin={5,15,30};
public static int[] FreeSpinGame=new int [3];
public static int TIMEX=12;
public static int spinX;
public static Vector2 Size;
//token win rate
public static int[,] Tok=new int[13,4];
// //Bet
public static float[] BetS={0.10F,0.25F,0.5F,1F,2F,5F,10F,15F,20F,25F,30F,35F,40F,45F};
public static int tema=1;
public static bool sunet=true,vibratie=true;
string URL="http://slot.phpfogapp.com/query2.php";
string URL1="http://slot.phpfogapp.com/devices.php";
//string URL="http://www.x-2.info/SlotMachine/query2.php";
//string URL1="http://www.x-2.info/SlotMachine/devices.php";
public string url = "http://images.earthcam.com/ec_metros/ourcams/fridays.jpg";
private Texture2D Tex;
WWW Info;
WWW InfoX;
private int moneydownload=100;
public static string MoneyTime;
public static System.DateTime MoneyTime2;
public static string LevelText;
private double TimeDownload;
private float Level2;
public GameObject Ios1,Ios2,And1,And2;
private int q;
public static string text1="gol";
void Start ()
{
if(PlayerPrefs.GetFloat("money",-1)==-1)
{
PlayerPrefs.SetString("Date","500@0@1@10@1#2#3#4#5#6#7#8#9#10@11@1#2#3#4#5#6#7#8#9#10#11@12@1#2#3#4#5#6#7#8#9#10#11#12@13@1#2#3#4#5#6#7#8#9#10#11#12#1@14@1#2#3#4#5#6#7#8#9#10#11#12#1#2@1#2#3#4#5#6#7#8#9#10#20#30#40#50@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@2#3#4#5@3#4#5@5#10#20@1@1000@1000@200@1000@1000@200@@");
}
MoneyTime=PlayerPrefs.GetString("TimeR",System.DateTime.Now.ToString()+"");
try
{
print(System.DateTime.Parse(Global.MoneyTime));
}
catch
{
MoneyTime=System.DateTime.Now.ToString();
PlayerPrefs.SetString("TimeR",MoneyTime);
}
MoneyTime2=System.DateTime.Parse(MoneyTime);
SoundS=gameObject.audio;
#if UNITY_ANDROID
Instantiate(And1);
Instantiate(And2);
#elif UNITY_IPHONE
// Instantiate(Ios1);
// Instantiate(Ios2);
#endif
SpinNR=PlayerPrefs.GetFloat("SpinNR",0);
Size.x=(float)Screen.width/960;
Size.y=(float)Screen.height/640;
DontDestroyOnLoad(this);
TimeDownload=Time.time;
StartCoroutine(DownloadData());
}
bool _facebookGetInfoRunning = false;
IEnumerator _facebookGetInfo() {
_facebookGetInfoRunning=true;
//print("Login Successful.");
FacebookUnityPlugin.GenericRequest("me",parameters,state);
while (FacebookUnityPlugin.response.StartsWith("Login"))
yield return new WaitForSeconds(1);
test=FacebookUnityPlugin.response;
int first = test.IndexOf("id");
int last = test.LastIndexOf("first_name");
string username = test.Substring(first, last - first);
string[] words = username.Split('"');
username=words[2];
facebookUserID=username;
FacebookUnityPlugin.GenericRequest("me/friends",parameters,state);
_facebookGetInfoRunning=false;
sendInfo=true;
}
// Update is called once per frame
void Update ()
{
q=PlayerPrefs.GetInt("BUYCoin",-1);
if(q!=-1)
{
BUYMONEY=true;
print(" "+q);
switch(q)
{
case 1:
money=money+buyCoin1;
PlayerPrefs.SetInt("BUYCoin",-1);
break;
case 2:
money=money+buyCoin2;
PlayerPrefs.SetInt("BUYCoin",-1);
break;
case 3:
money=money+buyCoin3;
PlayerPrefs.SetInt("BUYCoin",-1);
break;
case 4:
money=money+buyCoin4;
PlayerPrefs.SetInt("BUYCoin",-1);
break;
case 5:
money=money+buyCoin5;
PlayerPrefs.SetInt("BUYCoin",-1);
break;
case 6:
money=money+buyCoin6;
PlayerPrefs.SetInt("BUYCoin",-1);
break;
}
}
#if UNITY_ANDROID
if(!Meniu.test1 && facebookUserID=="2")
{
if (!_facebookGetInfoRunning)
StartCoroutine(_facebookGetInfo());
}
if( facebookUserID!="2" &&FacebookUnityPlugin.response.StartsWith("Login"))
{
FacebookUnityPlugin.response ="";
test=FacebookUnityPlugin.response;
text1+=test;
int first = test.IndexOf("&access_token=");
int last = test.LastIndexOf("&limit=");
string AT = test.Substring(first, last - first);
string[] words = AT.Split('=');
AT=words[1];
facebookToken=AT;
FacebookUnityPlugin.GenericRequest("me/friends",parameters,state);
}
#elif UNITY_IPHONE
if(FacebookBinding.isLoggedIn() && (facebookToken=="2"|| facebookUserID== "2"))
{
facebookToken=FacebookBinding.getFacebookAccessToken();
FacebookBinding.graphRequest( "me", "GET", new Hashtable() );
SocialNetworkingManager.facebookReceivedCustomRequest += delegate( object result )
{
ResultLogger.logObject( result );
facebookUserID=ResultLogger.info2;
};
}
#endif
if(facebookUserID!="2"&& facebookToken!="2"&& sendInfo)
{
sendInfo=false;
StartCoroutine(UploadData());
}
if(r==0)
{
SoundS.volume=0;
}
else
{
SoundS.volume=1;
}
if(NrLevel>NrLevelMax)
{
if(NrLevel<=250)
{
NrLevelMax=250;
Level=1;
TLevel=(Texture2D)Resources.Load("Level/l1");
}
else
{
if(NrLevel<=1000)
{
NrLevelMax=1000;
Level=2;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[5];
TLevel=(Texture2D)Resources.Load("Level/l2");
}
else
{
if(NrLevel<=2500)
{
NrLevelMax=2500;
Level=3;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[6];
TLevel=(Texture2D)Resources.Load("Level/l3");
}
else
{
if(NrLevel<=4500)
{
NrLevelMax=4500;
Level=4;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[7];
TLevel=(Texture2D)Resources.Load("Level/l4");
}
else
{
if(NrLevel<=7000)
{
NrLevelMax=7000;
Level=5;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[8]+"\n\n New Theme Unlocked";
TLevel=(Texture2D)Resources.Load("Level/l5");
}
else
{
if(NrLevel<=10000)
{
NrLevelMax=10000;
Level=6;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[9];
TLevel=(Texture2D)Resources.Load("Level/l6");
}
else
{
if(NrLevel<=13000)
{
NrLevelMax=13000;
Level=7;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[10];
TLevel=(Texture2D)Resources.Load("Level/l7");
}
else
{
if(NrLevel<=16500)
{
NrLevelMax=16500;
Level=8;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[11];
TLevel=(Texture2D)Resources.Load("Level/l8");
}
else
{
if(NrLevel<=20000)
{
NrLevelMax=20000;
Level=9;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[12];
TLevel=(Texture2D)Resources.Load("Level/l9");
}
else
{
if(NrLevel<=25000)
{
NrLevelMax=25000;
Level=10;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[13]+"\n\n New Theme Unlocked";
TLevel=(Texture2D)Resources.Load("Level/l10");
}
}
}
}
}
}
}
}
}
}
//PlayerPrefs.SetFloat("Level",Level);
}
if(Level!=Level2 && UPDATE)
{
print("LEVEL UP_________________"+Level);
SlotMachineT_1.ShowLVLTxt=true;
Level2=Level;
}
}
void OnApplicationQuit()
{
PlayerPrefs.SetString("TimeR",MoneyTime+"");
PlayerPrefs.SetFloat("money",money);
PlayerPrefs.SetFloat("NrLevel",NrLevel);
PlayerPrefs.SetFloat("SpinNR",SpinNR);
PlayerPrefs.SetFloat("Level",Level);
//print("send");
//StartCoroutine(DownloadInfo2());
//Application.Quit();
StartCoroutine(UploadData());
}
void OnApplicationPause()
{
if(Meniu.test1)
{
FacebookUnityPlugin.Init("401492759912062",permissions);
FacebookUnityPlugin.GenericRequest("me/friends",parameters,state);
}
PlayerPrefs.SetString("TimeR",MoneyTime+"");
PlayerPrefs.SetFloat("money",money);
PlayerPrefs.SetFloat("NrLevel",NrLevel);
PlayerPrefs.SetFloat("SpinNR",SpinNR);
PlayerPrefs.SetFloat("Level",Level);
//print("send");
//StartCoroutine(DownloadInfo2());
//Application.Quit();
StartCoroutine(UploadData());
}
IEnumerator DownloadInfo2()
{
WWWForm form = new WWWForm();
form.AddField("ID", SystemInfo.deviceUniqueIdentifier+"" );
form.AddField("money", money+"" );
form.AddField("spins",SpinNR+"");
form.AddField("level",NrLevel+"");
//facebookToken=facebookUserID="5";
form.AddField("facebook",facebookToken+"");
form.AddField("fb_id",facebookUserID+"");
//print("1234567890 "+facebookToken+" "+facebookUserID);
WWW InfoX = new WWW(URL1, form);
yield return InfoX;
}
void Analiza(WWW Info)
{
#region Q
print("++++++++++++++++++1"+Info.text);
print(PlayerPrefs.GetString("Date")+" ");
PlayerPrefs.SetString("Date",Info.text);
if(Info.text.Length>1)
{
string[] words=Info.text.Split('@');
//words[0]= money
print("++++++++++++++++++1"+Info.text);
//B1 =split
//B2 =split
//B3 =split
//B4 =split
//B5 =split
// print(money+"______"+int.Parse(words[0])+"_____"+PlayerPrefs.GetFloat("money")+"_______");
print(Info.text+"");
for(int i =0 ;i<words.Length;i++)
{
print(i+"___"+words[i]+"_____");
}
print(PlayerPrefs.GetFloat("money",-1)+" money"+" "+words[0]);
if(PlayerPrefs.GetFloat("money",-1)==-1)
{
money=Mathf.Ceil(int.Parse(words[0]));
SpinNR=int.Parse(words[1]);
NrLevel=int.Parse(words[2]);
}
else
{
money=Mathf.Ceil(PlayerPrefs.GetFloat("money"));
SpinNR=(int)PlayerPrefs.GetFloat("SpinNR");
NrLevel=(int)PlayerPrefs.GetFloat("NrLevel");
}
//B1
BxNR[0]= int.Parse(words[3]);
string[] wordsB=words[4].Split('#');
B1=new int[BxNR[0]];
for(int k=0;k<BxNR[0];k++)
{
B1[k]=int.Parse(wordsB[k]);
}
//B2
BxNR[1]=int.Parse(words[5]);
wordsB=words[6].Split('#');
B2=new int[BxNR[1]];
for(int k=0;k<BxNR[1];k++)
{
B2[k]=int.Parse(wordsB[k]);
}
//B3
BxNR[2]=int.Parse(words[7]);
wordsB=words[8].Split('#');
B3=new int[BxNR[2]];
for(int k=0;k<BxNR[2];k++)
{
B3[k]=int.Parse(wordsB[k]);
}
//B4
BxNR[3]=int.Parse(words[9]);
wordsB=words[10].Split('#');
B4=new int[BxNR[3]];
for(int k=0;k<BxNR[3];k++)
{
B4[k]=int.Parse(wordsB[k]);
}
//B5
BxNR[4]=int.Parse(words[11]);
wordsB=words[12].Split('#');
B5=new int[BxNR[4]];
for(int k=0;k<BxNR[4];k++)
{
B5[k]=int.Parse(wordsB[k]);
}
//BetS
wordsB=words[13].Split('#');
for(int k=0;k<13;k++)
{
BetS[k]=float.Parse(wordsB[k]);
}
//Tok
for(int j=4;j<13;j++)
{
wordsB=words[10+j].Split('#');
for(int k=0;k<4;k++)
{
print(j+" "+k);
Tok[j,k]=int.Parse(wordsB[k]);
}
}
wordsB=words[23].Split('#');
for(int k=0;k<3;k++)
{
NRFspinToken[k]=int.Parse(wordsB[k]);
}
wordsB=words[24].Split('#');
for(int k=0;k<3;k++)
{
NRFspin[k]=int.Parse(wordsB[k]);
}
TIMEX=int.Parse(words[25]);
buyCoin1=int.Parse(words[26]);
buyCoin2=int.Parse(words[27]);
buyCoin3=int.Parse(words[28]);
buyCoin4=int.Parse(words[29]);
buyCoin5=int.Parse(words[30]);
buyCoin6=int.Parse(words[31]);
//print(" "buyCoin1);
//MONEYBUY=int.Parse(words[27]);
//MONEYBUY=int.Parse(words[28]);
//print("++++++++++++++++++2");
//////
LevelUP();
Level2=Level;
DownloadDONE=true;
UPDATE=true;
////
}
else
{
Analiza2(DataStart);
}
#endregion Q
}
IEnumerator DownloadInfo(WWW InfoX)
{
WWWForm form = new WWWForm();
form.AddField("ID", SystemInfo.deviceUniqueIdentifier+"" );
form.AddField("money", Global.money+"" );
form.AddField("spins",Global.SpinNR+"");
form.AddField("level",Global.NrLevel+"");
form.AddField("facebook",Global.facebookToken+"");
form.AddField("fb_id",Global.facebookUserID+"");
InfoX = new WWW(URL1, form);
yield return InfoX;
Analiza(InfoX);
if(TimeDownload+5<Time.time)
{
yield return null;
Analiza2(PlayerPrefs.GetString("Date",DataStart));
}
}
void Analiza2(string Info)
{
#region Q
if(Info.Length>0)
{
string[] words=Info.Split('@');
//words[0]= money
//B1 =split
//B2 =split
//B3 =split
//B4 =split
//B5 =split
print("_-_-_-"+Info);
for(int i =0 ;i<words.Length;i++)
{
print(i+"___"+words[i]+"_____");
}
if(PlayerPrefs.GetFloat("money",-1)==-1)
{
money=Mathf.Ceil(int.Parse(words[0]));
SpinNR=int.Parse(words[1]);
NrLevel=int.Parse(words[2]);
}
else
{
money=Mathf.Ceil(PlayerPrefs.GetFloat("money"));
SpinNR=(int)PlayerPrefs.GetFloat("SpinNR");
NrLevel=(int)PlayerPrefs.GetFloat("NrLevel");
}
//B1
BxNR[0]= int.Parse(words[3]);
string[] wordsB=words[4].Split('#');
B1=new int[BxNR[0]];
for(int k=0;k<BxNR[0];k++)
{
B1[k]=int.Parse(wordsB[k]);
}
//B2
BxNR[1]=int.Parse(words[5]);
wordsB=words[6].Split('#');
B2=new int[BxNR[1]];
for(int k=0;k<BxNR[1];k++)
{
B2[k]=int.Parse(wordsB[k]);
}
//B3
BxNR[2]=int.Parse(words[7]);
wordsB=words[8].Split('#');
B3=new int[BxNR[2]];
for(int k=0;k<BxNR[2];k++)
{
B3[k]=int.Parse(wordsB[k]);
}
//B4
BxNR[3]=int.Parse(words[9]);
wordsB=words[10].Split('#');
B4=new int[BxNR[3]];
for(int k=0;k<BxNR[3];k++)
{
B4[k]=int.Parse(wordsB[k]);
}
//B5
BxNR[4]=int.Parse(words[11]);
wordsB=words[12].Split('#');
B5=new int[BxNR[4]];
for(int k=0;k<BxNR[4];k++)
{
B5[k]=int.Parse(wordsB[k]);
}
//BetS
wordsB=words[13].Split('#');
for(int k=0;k<13;k++)
{
BetS[k]=float.Parse(wordsB[k]);
}
//Tok
for(int j=4;j<13;j++)
{
wordsB=words[10+j].Split('#');
for(int k=0;k<4;k++)
{
print(j+" "+k);
Tok[j,k]=int.Parse(wordsB[k]);
}
}
wordsB=words[23].Split('#');
for(int k=0;k<3;k++)
{
NRFspinToken[k]=int.Parse(wordsB[k]);
}
wordsB=words[24].Split('#');
for(int k=0;k<3;k++)
{
NRFspin[k]=int.Parse(wordsB[k]);
}
TIMEX=int.Parse(words[25]);
buyCoin1=int.Parse(words[26]);
buyCoin2=int.Parse(words[27]);
buyCoin3=int.Parse(words[28]);
buyCoin4=int.Parse(words[29]);
buyCoin5=int.Parse(words[30]);
buyCoin6=int.Parse(words[31]);
//MONEYBUY=int.Parse(words[26]);
//MONEYBUY=int.Parse(words[27]);
//MONEYBUY=int.Parse(words[28]);
print("++++++++++++++++++2");
LevelUP();
Level2=Level;
DownloadDONE=true;
UPDATE=true;
}
#endregion Q
}
public static void Sound1 ()
{
// tema
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound/1");
SoundS.Play();
}
public static void Sound2 ()
{
// spin con
SoundS.loop=true;
SoundS.clip=(AudioClip)Resources.Load("Sound/2");
SoundS.Play();
}
public static void Sound3 ()
{
// spin end
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound/3");
SoundS.Play();
}
public static void Sound4 ()
{
// win
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound/4");
SoundS.Play();
}
public static void Sound5 ()
{
// click
// SoundS.audio.priority=4;
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound/6");
SoundS.Play();
}
public static void Sound6 ()
{
// lines/ bet
// SoundS.audio.priority=4;
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound/7");
SoundS.Play();
}
public static void Sound_Audio0 ()
{
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound2/1");
SoundS.Play();
}
public static void Sound_Audio1 ()
{
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound2/2");
SoundS.Play();
}
public static void Sound_Audio2 ()
{
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound2/3");
SoundS.Play();
}
public static void Sound_Audio3 ()
{
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound2/4");
SoundS.Play();
}
public static void Sound_Audio4 ()
{
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound2/5");
SoundS.Play();
}
public static void Sound_Audio5 ()
{
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound2/6");
SoundS.Play();
}
public static void Sound_Audio6 ()
{
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound2/7");
SoundS.Play();
}
public static void Sound_Audio7 ()
{
SoundS.loop=false;
SoundS.clip=(AudioClip)Resources.Load("Sound2/8");
SoundS.Play();
}
public static void SoundStop ()
{
SoundS.Stop();
}
IEnumerator DownloadData()
{
WWWForm form = new WWWForm();
form.AddField("stare","0");
form.AddField("ID", SystemInfo.deviceUniqueIdentifier+"" );
form.AddField("money", money+"" );
form.AddField("spins",SpinNR+"");
form.AddField("level",NrLevel+"");
form.AddField("facebook",facebookToken+"");
form.AddField("fb_id",facebookUserID+"");
print(SystemInfo.deviceUniqueIdentifier+" "+money);
WWW InfoX = new WWW(URL1, form);
if(TimeDownload+10<Time.time)
{
yield return null;
Analiza2(PlayerPrefs.GetString("Date",DataStart));
}
yield return InfoX;
Analiza(InfoX);
}
IEnumerator UploadData()
{
WWWForm form = new WWWForm();
form.AddField("stare","1");
form.AddField("ID", SystemInfo.deviceUniqueIdentifier+"" );
form.AddField("money", money+"" );
form.AddField("spins",SpinNR+"");
form.AddField("level",NrLevel+"");
form.AddField("facebook",facebookToken+"");
form.AddField("fb_id",facebookUserID+"");
print(form.data.ToString());
WWW InfoX = new WWW(URL1, form);
yield return InfoX;
}
void LevelUP()
{
if(NrLevel<=250)
{
NrLevelMax=250;
Level=1;
TLevel=(Texture2D)Resources.Load("Level/l1");
}
else
{
if(NrLevel<=1000)
{
NrLevelMax=1000;
Level=2;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[5];
TLevel=(Texture2D)Resources.Load("Level/l2");
}
else
{
if(NrLevel<=2500)
{
NrLevelMax=2500;
Level=3;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[6];
TLevel=(Texture2D)Resources.Load("Level/l3");
}
else
{
if(NrLevel<=4500)
{
NrLevelMax=4500;
Level=4;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[7];
TLevel=(Texture2D)Resources.Load("Level/l4");
}
else
{
if(NrLevel<=7000)
{
NrLevelMax=7000;
Level=5;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[8]+"\n\n New Theme Unlocked";
TLevel=(Texture2D)Resources.Load("Level/l5");
}
else
{
if(NrLevel<=10000)
{
NrLevelMax=10000;
Level=6;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[9];
TLevel=(Texture2D)Resources.Load("Level/l6");
}
else
{
if(NrLevel<=13000)
{
NrLevelMax=13000;
Level=7;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[10];
TLevel=(Texture2D)Resources.Load("Level/l7");
}
else
{
if(NrLevel<=16500)
{
NrLevelMax=16500;
Level=8;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[11];
TLevel=(Texture2D)Resources.Load("Level/l8");
}
else
{
if(NrLevel<=20000)
{
NrLevelMax=20000;
Level=9;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[12];
TLevel=(Texture2D)Resources.Load("Level/l9");
}
else
{
if(NrLevel<=25000)
{
NrLevelMax=25000;
Level=10;
//SlotMachineT_1.ShowLVLTxt=true;
LevelText="Max bet,now "+BetS[13]+"\n\n New Theme Unlocked";
TLevel=(Texture2D)Resources.Load("Level/l10");
}
}
}
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment