public static void Bubbling(int score, Transform trans, int id) { ScoreBubble bubble = ContentAssistant.main.GetItem <ScoreBubble>("ScoreBubble", trans.position); bubble.score = score; bubble.colorID = id; }
public static void Initialize() { canvas = GameObject.Find("Canvas"); if (!scoreBubble) { scoreBubble = Resources.Load <ScoreBubble>("Prefabs/PopupTextParent"); } }
public static void CreateScoreBubble(string text, Transform location) { ScoreBubble instance = Instantiate(scoreBubble); Vector2 screenPosition = Camera.main.WorldToScreenPoint(new Vector2(location.position.x + Random.Range(-.2f, .2f), location.position.y + Random.Range(-.2f, .2f))); instance.transform.SetParent(canvas.transform, false); instance.transform.position = screenPosition; instance.SetText(text); }
public void SetScore(float s) { if (id < 0 || id > 5) { return; } SessionAssistant.main.score += Mathf.RoundToInt(s * SessionAssistant.scoreC); ScoreBubble.Bubbling(Mathf.RoundToInt(s * SessionAssistant.scoreC), transform, id); }
// Adding score points public void SetScore(float s) { SessionAssistant.main.score += Mathf.RoundToInt(s * SessionAssistant.scoreC); ScoreBubble.Bubbling(Mathf.RoundToInt(s * SessionAssistant.scoreC), transform, id); }
public void SetScore(float s) { MatchThree.main.score += Mathf.RoundToInt(s * MatchThree.scoreC); ScoreBubble.Bubbling(Mathf.RoundToInt(s * MatchThree.scoreC), transform); }