/// <summary>
    /// Function called before of the first update. Used to initialize the components.
    /// </summary>
    void Start()
    {
        dC = GetComponent <dataCollector>();

        wallspinscontainer = transform.Find("wallspinscontainer");
        dronepinscontainer = transform.Find("dronepinscontainer");

        lr = gameObject.AddComponent <LineRenderer>();
        lr.SetVertexCount(5);
        Vector3 pt = transform.position;

        // draw the borders
        lr.SetPosition(0, pt);
        lr.SetPosition(1, (pt += Vector3.right * maxMapSize));
        lr.SetPosition(2, (pt += Vector3.forward * maxMapSize));
        lr.SetPosition(3, (pt += Vector3.right * -maxMapSize));
        lr.SetPosition(4, (pt += Vector3.forward * -maxMapSize));

        // initialize the drone-Pins, used to show the drones positions
        dronesPins = new GameObject[10];
        for (int i = 0; i < dronesPins.Length; i++)
        {
            dronesPins[i] = (GameObject)Instantiate(dronePin, new Vector3(), Quaternion.identity * Quaternion.AngleAxis(90, Vector3.right));
            dronesPins[i].transform.parent = dronepinscontainer;
        }
    }
Example #2
0
 /// <summary>
 /// Function called before of the first update. Used to initialize the components.
 /// </summary>
 void Start()
 {
     dC     = GameObject.FindGameObjectWithTag("dataCollector").GetComponent <dataCollector>();
     ticket = dC.initialize(transform.position);
     setSinglePointcommandResponsive(false);
     lockSinglePoint();
     setDistanceOfPointToLookAt(1000);
     myGraph = new Graph(transform.position, dC.data, NodeObject, deadNodeMaterial, doNotSpawnAnything);
 }
Example #3
0
 // Use this for initialization
 void Start()
 {
     data = GameObject.Find("DataCollector").GetComponent <dataCollector>();
 }
	// Use this for initialization
	void Start () {
		data = GameObject.Find("DataCollector").GetComponent<dataCollector>();
	}