Beispiel #1
0
 void Start()
 {
     GameObject g = new GameObject();
     g.transform.SetParent (transform);
     g.name = "(built wire)";
     w = g.AddComponent<WireRenderer>();
     if (overrideWithRandom) {
         outwardDistance = Random.Range(0.06f,0.12f);
         downwardDistance = Mathf.Pow(Random.Range (0.15f,.65f),2f);
     }
     w.outwardDirection = transform.rotation;
     w.SetWire(start,end,outwardDistance,downwardDistance);
     if (setLooks) w.SetLooks(colour,width);
     w.BuildWire();
     g.AddComponent<LineRendererCulling>().hideUnlessBehind = hideUnlessBehind;
     Destroy (this);
 }
Beispiel #2
0
        protected override void LoadContent()
        {
            RenderHelper.Init(GraphicsDevice);
            _camera    = new Camera();
            _grid      = new GridOverlay();
            _spotMap   = new SpatialMap <WireSpot>(80);
            _grid.Size = new Vector2(_spotMap.CellSize);

            _wireRenderer = new WireRenderer();
            WireGenerator.DefaultSpotDensity = 10;
            //_wire = WireGenerator.MakeCircle(new Vector2(350, 250), 200);
            _wire = WireGenerator.MakeRandomPath(new Vector2(50, 200), 0, 500, 50, 0, .5f);

            _player = new Player(_wire);

            base.LoadContent();
        }
 void Start()
 {
     wr = GetComponent<WireRenderer>();
     lr = GetComponent<LineRenderer>();
 }