20 lines
677 B
C#
20 lines
677 B
C#
using UnityEngine;
|
|
|
|
namespace InterfaceOff
|
|
{
|
|
public class MovingWindow : WindowBase
|
|
{
|
|
protected override void OnWindowInstantiation()
|
|
{
|
|
/* Adds a random advert to the display */
|
|
Advert advert = AdvertRegistry.GetRandomAdvert();
|
|
Components.WindowImage.sprite = advert.Image;
|
|
Components.InfoText.text = advert.Name;
|
|
Components.WindowImage.color = new Color(1, 1, 1, 1);
|
|
|
|
/* Calculates a random velocity direction */
|
|
float angle = Random.Range(0, Mathf.PI * 2);
|
|
Velocity = new Vector2(Mathf.Cos(angle), Mathf.Sin(angle)) * 100;
|
|
}
|
|
}
|
|
} |