public void Init() { Data.Instance.videogamesData.SetOtherGameActive(); if (Data.Instance.playMode != Data.PlayModes.SURVIVAL && Data.Instance.playMode != Data.PlayModes.PARTYMODE) { GetComponent <GameOverPartyMode> ().Init(); return; } if (arcadeRanking.all.Count == 0) { return; } hiscore = (float)arcadeRanking.all [0].hiscore; SetTopTenImage(); panel.SetActive(true); score = Data.Instance.multiplayerData.score; ArcadeRanking.Hiscore myTempHiscore = new ArcadeRanking.Hiscore(); myTempHiscore.hiscore = score; myTempHiscore.username = "******"; mySignal = AddSignal(myTempHiscore, 120); float gotoX = mySignal.transform.localPosition.x; if (gotoX > 100) { gotoX = 100; } Vector3 pos = mySignal.transform.localPosition; pos.x = 0; mySignal.transform.localPosition = pos; iTween.MoveTo(mySignal.gameObject, iTween.Hash( "x", gotoX, "islocal", true, "time", 2 )); StartCoroutine(DrawHiscores()); }
HiscoresComparisonSignal AddSignal(ArcadeRanking.Hiscore data, int puesto) { float normalizedPos = GetNormalizedPosition(data.hiscore); HiscoresComparisonSignal newSignal = Instantiate(signal); newSignal.transform.SetParent(container); newSignal.transform.localScale = Vector3.one; if (puesto == 1 || puesto > 10) { newSignal.Init(data.username, data.hiscore, puesto); } else { newSignal.Init("", 0, 0); } float _x = GetNormalizedPosition(data.hiscore); newSignal.transform.localPosition = new Vector3(_x, 0, 0); return(newSignal); }