public void Display(MiniGame minigame) { _spriteRenderer.gameObject.SetActive(true); switch (minigame) { case MiniGame.paper: _spriteRenderer.sprite = _paper; break; case MiniGame.rock: _spriteRenderer.sprite = _rock; break; case MiniGame.scissors: _spriteRenderer.sprite = _scissors; break; } switch (_playerColor) { case PlayerColor.red: _spriteRenderer.color = Color.red; break; case PlayerColor.blue: _spriteRenderer.color = Color.blue; break; case PlayerColor.green: _spriteRenderer.color = Color.green; break; case PlayerColor.yellow: _spriteRenderer.color = Color.yellow; break; } _transformFunctions.Scale(_spriteRenderer.transform, Vector3.one * _scale, 0, _time, _curve); IEnumerator _Close() { const float _TIME_DISPLAY = 1.5f; // ne kadar süre sonra kapanacak. yield return(new WaitForSeconds(_TIME_DISPLAY)); Close(); } StartCoroutine(_Close()); }
public void TestCreatePowerUp() { GameObject newPowerUp = Instantiate(powerUpObject[(int)_testType]); GameObject newPowerUpParent = Instantiate(powerUpContainer); newPowerUp.transform.SetParent(newPowerUpParent.transform); newPowerUpParent.transform.localPosition = new Vector3( Random.Range(minPoint.transform.position.x, maxPoint.transform.position.x), 0.1f, Random.Range(minPoint.transform.position.z, maxPoint.transform.position.z) ); Vector3 originScale = newPowerUp.transform.localScale; newPowerUp.transform.localScale = Vector3.zero; TF.Scale(newPowerUp.transform, originScale, 0f, 0.5f, showCurve); }
public void Add(StuffController stuff) { if (area == Area.Neutral) { return; } if (!_listStuff.Contains(stuff)) { _listStuff.Add(stuff); stuff.BreakAllPlayers(); Collider[] cols = stuff.GetComponents <Collider>(); foreach (Collider col in cols) { Destroy(col); } Destroy(stuff.GetComponent <Rigidbody>()); if (stuff.GetComponent <AudioSource>() != null) { StartCoroutine(_SoundOut(stuff.GetComponent <AudioSource>())); } //is gold değişkeni kapanmaması için stuff.StopAllCoroutines(); TF.Move(stuff.transform, moveToHere, moveDelay, moveTime, moveCurve); TF.Scale(stuff.transform, moveToHere, moveDelay, moveTime, moveCurve); TF.Rotate(stuff.transform, moveToHere, moveDelay, moveTime, moveCurve); } _scoreController.UpdateScore(area, CountStuffs()); }
void DestroyThis() { GetComponent <Collider>().enabled = false; StartCoroutine(_Destroy()); TF.Scale(transform, targetScale, 0f, 0.33f, destroyCurve); }
public void ReadBig(Transform current) { tf.SetActiveAfter(current.gameObject, true, 0); tf.Scale(current, Vector3.one, 0, .3f); }