Exemplo n.º 1
0
 void Attract()
 {
     foreach (GameObject attractable in GameObject.FindGameObjectsWithTag("Attractable"))
     {
         attractable.GetComponent <Rigidbody2D>().AddForce((FitInScreenHelper.GetDirection(transform.position, attractable.transform.position) * 35f * Time.deltaTime));
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (player != null)
        {
            dist = FitInScreenHelper.GetDistance(transform.position, player.transform.position);
        }

        sprRndr.color = initColor * dist + Color.white * (1 - dist);
    }