Esempio n. 1
0
 private void reset_line()
 {
     if (line_autoremove && tmp_line != null)
     {
         Destroy(tmp_line);
     }
     tmp_obj       = null;
     tmp_line      = null;
     tmp_wire      = null;
     pick_distance = 0;
     pick_position = new Vector3();
     last_point    = new Vector3();
     points        = new List <Vector3>();
     wire_segments = 0;
 }
Esempio n. 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();
        }
    private void generate_wire()
    {
        if (tmp_obj == null || wire_generator == null)
        {
            return;
        }
        GameObject tw = Instantiate(wire_generator.gameObject);

        tw.name                    = "wire";
        tw.transform.parent        = tmp_obj.transform;
        tw.transform.localPosition = new Vector3();
        tmp_wire                   = tw.GetComponent <WireGenerator>();

        if (wire_animated)
        {
            tmp_wire.animated = true;
            tmp_wire.play     = true;
        }
    }
Esempio n. 4
0
 void OnEnable()
 {
     _generator = target as WireGenerator;
     _isLinking = false;
 }