Can someone explain to me what does the code says?

Updated on August 11, 2017 in [A] Tutorials
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
0 on August 11, 2017

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameSetup : MonoBehaviour {

public Camera mainCam;

public BoxCollider2D topWall;
public BoxCollider2D bottomWall;
public BoxCollider2D leftWall;
public BoxCollider2D rightWall;

public Transform Player01;
public Transform Player02;

// Update is called once per frame
void Update () {
                                           —————-//this section—————-
topWall.size = new Vector2(mainCam.ScreenToWorldPoint(new Vector3(Screen.width * 2f, 0f, 0f)).x, 1f);
topWall.center = new Vector2(0f,mainCam.ScreenToWorldPoint(new Vector3(0f, Screen.height, 0f)).y + 0.5f);
}
}

I’m creating the pong game of the tutorial 

  • Liked by
Reply