Esempio n. 1
0
 void Start()
 {
     levelManager = GameObject.FindObjectOfType <LevelManager>();
     ball         = GameObject.FindObjectOfType <BallMech>();
     paddle       = GameObject.FindObjectOfType <Paddle>();
     gamemgt      = GameObject.FindObjectOfType <GameMgt>();
 }
Esempio n. 2
0
    void Start()
    {
        audioplay       = GetComponent <AudioSource>();
        ball            = GameObject.FindObjectOfType <BallMech>();
        ControlSettings = PlayerPrefMgt.GetControl();// options 0 = Mouse 1 = KB
        //below setting for keyboard controls
        float   distance  = transform.position.z - Camera.main.transform.position.z;
        Vector3 leftmost  = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, distance));
        Vector3 rightmost = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, distance));

        xmin = leftmost.x + padding;
        xmax = rightmost.x - padding;
    }