private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.name == "BlockRemover") { BlockPlatformer.BlockDestroyer(gameObject); } }
void Start() { progressBar = GameObject.Find("RadialProgressBar"); CoinPlus = 0; hold = GameObject.Find("HoldPanel"); survivePanel = GameObject.Find("Survive Panel"); survivePanel.GetComponentInChildren <ProgressOficial>().Speed = 0; ScoreText = GameObject.Find("Score").GetComponent <Text>(); PlayerPrefs.SetInt("coinplus", 0); this.Points = new Vector3[2] { GameObject.Find("lu").transform.position, GameObject.Find("rd").transform.position }; ScreenAndCam = GameObject.Find("Main Camera").GetComponent <ScreenAndCamera>(); Time.timeScale = 1; MultipleCoinAmount = 1; _coin = 0; score = 0; ScoreText.text = "0"; startGift = Random.Range(5, 11); LastScoreText = GameObject.Find("Last Score Text").GetComponent <Text>(); LastScoreText.text = (PlayerPrefs.GetInt("LastScore", 0)).ToString(); State = GameStatus.Start; HighScore = PlayerPrefs.GetInt("HighScore", HighScore); Coin = PlayerPrefs.GetInt("Coin", Coin); CoinText = GameObject.Find("Coin Text").GetComponent <Text>(); CoinText.text = Coin.ToString(); giftActs = new GiftActs(gameObject, progressBar, blooooooooock, GiftMusic); Blocks = new BlockPlatformer(Block, BlockDistance); //_gift = new Gift(this.Gift, this.Points, this.progressBar); new GameSparks.Api.Requests.LogEventRequest().SetEventKey("LEADERBOARD_SCORER").SetEventAttribute("SCORER", int.Parse(PlayerPrefs.GetInt("HighScore", 0).ToString())).Send((response) => { if (!response.HasErrors) { Debug.Log("Score Posted Successfully..."); } else { Debug.Log("Error Posting Score..."); } }); }