Ejemplo n.º 1
0
    private void InitializeCircleComponents(FallingObject fallingObject)
    {
        float localScale = difficultyCalc.GetRandomScale();

        fallingObject.Initialize(difficultyCalc, localScale, cachedLevel);
        fallingObject.enabled = true;

        float spawnPointX = Random.Range(spawningStart.position.x, spawningEnd.position.x);

        fallingObject.transform.position = new Vector3(spawnPointX, spawningStart.position.y, 0f);

        var coloredCircle = fallingObject.GetComponent <RandomColoredCircle>();

        coloredCircle.Initialize(localScale);
    }
Ejemplo n.º 2
0
 public override void Play()
 {
     _fallingObject   = PlayMode.Instance.FallingObject;
     _targetRigidbody = _fallingObject.GetComponent <Rigidbody2D>();
     _targetRigidbody.AddForce((transform.position - _fallingObject.transform.position) * 50);
 }