Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        //headingTransform = transform.Find("headingRow");
        PopulateHeadings();
        int i = 0;

        //foreach(Transform child in Aircraft_parent.transform)
        //{


        //    GameObject rowGameObject = Instantiate(rowPrefab, transform) as GameObject;
        //    DashboardRow row = rowGameObject.GetComponent<DashboardRow>();
        //    row.SetIndex(0);
        //    row.SetWidth(width);
        //    row.Init();
        //    //row.SetPlane(child);
        //    //row.SetIdentifierName(child.transform.GetComponent<movement>().callsign);
        //    rowGameObject.transform.position = new Vector3(transform.position.x  + Xoffset, transform.position.y+ Yoffset, transform.position.z + (i * spacing) + Zoffset );

        //    rows.Add(rowGameObject);
        //    i++;
        //}
        //foreach (Transform child in Aircraft_parent.transform)
        //   plane.Add(child);

        while (i != height)
        {
            GameObject   rowGameObject = Instantiate(rowPrefab, transform) as GameObject;
            DashboardRow row           = rowGameObject.GetComponent <DashboardRow>();
            row.SetIndex(0);
            row.SetWidth(width);
            row.Init();
            //row.SetPlane(plane[i + (height * idy)].transform);
            //rowGameObject.transform.position = new Vector3(transform.position.x + Xoffset, transform.position.y + Yoffset, transform.position.z + (i * spacing) + Zoffset);
            rowGameObject.transform.position = new Vector3(transform.position.x + Xoffset, transform.position.y + (i * spacing) + Yoffset, transform.position.z + Zoffset);
            rows.Add(rowGameObject);
            i++;
        }

        transform.Rotate(new Vector3(75, 0, 0));
        //transform.parent.localScale = new Vector3(transform.parent.localScale.x - 0.2f, transform.parent.localScale.y, transform.parent.localScale.z);
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        headingTransform = transform.Find("headingRow");
        PopulateHeadings();
        int i = 0;


        while (i != height)
        {
            GameObject   rowGameObject = Instantiate(rowPrefab, transform) as GameObject;
            DashboardRow row           = rowGameObject.GetComponent <DashboardRow>();
            row.SetIndex(0);
            row.SetWidth(width);
            row.Init();
            //row.SetPlane(plane[i + (height * idy)].transform);
            //rowGameObject.transform.position = new Vector3(transform.position.x + Xoffset, transform.position.y + Yoffset, transform.position.z + (i * spacing) + Zoffset);
            rowGameObject.transform.position = new Vector3(transform.position.x + Xoffset, transform.position.y + (i * spacing) + Yoffset, transform.position.z + Zoffset);
            rows.Add(rowGameObject);
            i++;
        }

        transform.Rotate(new Vector3(75, 0, 0));
    }