public Figure CreateFigure() { LineDrawer drawer = new LineDrawer(); LineUpdater updater = new LineUpdater(); RegularMover mover = new RegularMover(); RegularRotator rotator = new RegularRotator(); RegularScaler scaler = new RegularScaler(); return(new Figure(drawer, scaler, updater, mover, rotator)); }
void CreateConnection(Point a, Point b) { Debug.Log("Connection created"); Line line = Drawer.drawer.CreateConnection(a, b); line.color = Color.red; line.gameObject.layer = 10; line.name = "EnemyLine"; LineUpdater updater = line.gameObject.AddComponent <LineUpdater>(); updater.from = a.transform; updater.to = b.transform; b.GetComponent <Rigidbody2D>().velocity = a.GetComponent <Rigidbody2D>().velocity; }