Beispiel #1
0
    void Start()
    {
        aV = aracVeri.Instance;

        yazi = aV.enIyıHedef;

        buton.GetComponent <Button>().GetComponentInChildren <Text>().text = yazi;
    }
Beispiel #2
0
 void Start()
 {
     db            = DBManager.Instance;
     aV            = aracVeri.Instance;
     lastPositionx = 0.0f;
     lastPositiony = 0.0f;
     lastPositionz = 0.0f;
 }
Beispiel #3
0
 void Start()
 {
     aV = aracVeri.Instance;
     //panel4 = GameObject.FindGameObjectWithTag("canvas4");
     if (aV.hedef == "yok")
     {
         panel4.SetActive(true);
     }
 }
Beispiel #4
0
 void Start()
 {
     pyv = parkYeriVeri.Instance;
     aV  = aracVeri.Instance;
 }
Beispiel #5
0
 void Start()
 {
     aV = aracVeri.Instance;
     db = DBManager.Instance;
 }
Beispiel #6
0
    void Start()
    {
        db  = DBManager.Instance;
        aV  = aracVeri.Instance;
        pyv = parkYeriVeri.Instance;
        //panel = GameObject.FindGameObjectWithTag("canvas");
        //panel2 = GameObject.FindGameObjectWithTag("canvas2");
        //panel3 = GameObject.FindGameObjectWithTag("canvas3");
        canvas  = panel.GetComponent <Canvas>();
        canvas2 = panel2.GetComponent <Canvas>();
        canvas3 = panel3.GetComponent <Canvas>();


        seciliArabaAdi = db.seciliArabaAdi;
        if (aV.hedef == "a1")
        {
            myHedef = hedefa1.transform.position;
        }
        if (aV.hedef == "a2")
        {
            myHedef = hedefa2.transform.position;
        }
        if (aV.hedef == "a3")
        {
            myHedef = hedefa3.transform.position;
        }
        if (aV.hedef == "a4")
        {
            myHedef = hedefa4.transform.position;
        }
        if (aV.hedef == "a5")
        {
            myHedef = hedefa5.transform.position;
        }
        if (aV.hedef == "a6")
        {
            myHedef = hedefa6.transform.position;
        }



        if (aV.hedef == "b1")
        {
            myHedef = hedefb1.transform.position;
        }
        if (aV.hedef == "b2")
        {
            myHedef = hedefb2.transform.position;
        }
        if (aV.hedef == "b3")
        {
            myHedef = hedefb3.transform.position;
        }
        if (aV.hedef == "b4")
        {
            myHedef = hedefb4.transform.position;
        }
        if (aV.hedef == "b5")
        {
            myHedef = hedefb5.transform.position;
        }
        if (aV.hedef == "b6")
        {
            myHedef = hedefb6.transform.position;
        }
        if (aV.hedef == "b7")
        {
            myHedef = hedefb7.transform.position;
        }
        if (aV.hedef == "b8")
        {
            myHedef = hedefb8.transform.position;
        }



        if (aV.hedef == "c1")
        {
            myHedef = hedefc1.transform.position;
        }
        if (aV.hedef == "c2")
        {
            myHedef = hedefc2.transform.position;
        }
        if (aV.hedef == "c3")
        {
            myHedef = hedefc3.transform.position;
        }
        if (aV.hedef == "c4")
        {
            myHedef = hedefc4.transform.position;
        }
        if (aV.hedef == "c5")
        {
            myHedef = hedefc5.transform.position;
        }
        if (aV.hedef == "c6")
        {
            myHedef = hedefc6.transform.position;
        }
        if (aV.hedef == "c7")
        {
            myHedef = hedefc7.transform.position;
        }
        if (aV.hedef == "c8")
        {
            myHedef = hedefc8.transform.position;
        }



        if (aV.hedef == "d1")
        {
            myHedef = hedefd1.transform.position;
        }
        if (aV.hedef == "d2")
        {
            myHedef = hedefd2.transform.position;
        }
        if (aV.hedef == "d3")
        {
            myHedef = hedefd3.transform.position;
        }
        if (aV.hedef == "d4")
        {
            myHedef = hedefd4.transform.position;
        }


        if (seciliArabaAdi == "araba1")
        {
            rotaCizilecekObje = araba1;
            myAgent           = agent1;
            Debug.Log("nav managede araba 1 çalıştı");
            //araba1.transform.position = new Vector3(araba1.transform.position.x, 0f, araba1.transform.position.z);
            //araba2.transform.position = new Vector3(araba2.transform.position.x, 100f, araba2.transform.position.z);
            //araba3.transform.position = new Vector3(araba3.transform.position.x, 100f, araba3.transform.position.z);
            araba1.SetActive(true);
            araba2.SetActive(false);
            araba3.SetActive(false);
            //araba1.GetComponent<NavMeshAgent>().enabled = true;
            //araba2.GetComponent<NavMeshAgent>().enabled = false;
            //araba3.GetComponent<NavMeshAgent>().enabled = false;
        }
        if (seciliArabaAdi == "araba2")
        {
            rotaCizilecekObje = araba2;
            myAgent           = agent2;
            Debug.Log("nav managede araba 2 çalıştı");
            //araba1.transform.position = new Vector3(araba1.transform.position.x, 100f, araba1.transform.position.z);
            //araba2.transform.position = new Vector3(araba2.transform.position.x, 0f, araba2.transform.position.z);
            //araba3.transform.position = new Vector3(araba3.transform.position.x, 100f, araba3.transform.position.z);
            araba1.SetActive(false);
            araba2.SetActive(true);
            araba3.SetActive(false);
            //araba1.GetComponent<NavMeshAgent>().enabled = false;
            //araba2.GetComponent<NavMeshAgent>().enabled = true;
            //araba3.GetComponent<NavMeshAgent>().enabled = false;
        }

        if (seciliArabaAdi == "araba3")
        {
            rotaCizilecekObje = araba3;
            myAgent           = agent3;
            Debug.Log("nav managede araba 3 çalıştı");
            //araba1.transform.position = new Vector3(araba1.transform.position.x, 100f, araba1.transform.position.z);
            //araba2.transform.position = new Vector3(araba2.transform.position.x, 100f, araba2.transform.position.z);
            //araba3.transform.position = new Vector3(araba3.transform.position.x, 0f, araba3.transform.position.z);
            //araba1.GetComponent<NavMeshAgent>().enabled = false;
            //araba2.GetComponent<NavMeshAgent>().enabled = false;
            //araba3.GetComponent<NavMeshAgent>().enabled = true;
            araba1.SetActive(false);
            araba2.SetActive(false);
            araba3.SetActive(true);
        }


        myLineRenderer            = rotaCizilecekObje.GetComponent <LineRenderer>();
        myLineRenderer.startWidth = 1f;
        myLineRenderer.endWidth   = 1f;
        //myLineRenderer.startColor = Color.black;
        //myLineRenderer.endColor = Color.white;
        //myLineRenderer.startColor = Color.blue;
        myLineRenderer.positionCount = 0;
        //NavMeshPath = new NavMeshPath();
        //agent4.Warp(_selection.position);
        //Quaternion orginalRot = transform.rotation;
        //_selection.rotation = orginalRot * Quaternion.AngleAxis(30,Vector3.up);
        myAgent.Warp(rotaCizilecekObje.transform.position);
        myAgent.SetDestination(myHedef);
    }