Esempio n. 1
0
    void Update()
    {
        wind w = this.windController.GetComponent <wind>();

        // Note -90 compensation cos north is along 2D Y axis
        rot  = (-90 + this.transform.eulerAngles.y - north) * Mathf.Deg2Rad;
        rotW = (-90 + w.getAngle() - north) * Mathf.Deg2Rad;

        // Bubble position
        x = radius * Mathf.Cos(rot);
        y = radius * Mathf.Sin(rot);

        xW = radius * Mathf.Cos(rotW);
        yW = radius * Mathf.Sin(rotW);
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     myWind      = GameObject.Find("wind").GetComponent <wind> ();
     playerColor = GameObject.Find("char").GetComponent <SpriteRenderer> ();
 }
 // Use this for initialization
 void Start()
 {
     myWind=GameObject.Find("wind").GetComponent<wind> ();
     playerColor = GameObject.Find("char").GetComponent<SpriteRenderer> ();
 }