コード例 #1
0
 void Start()
 {
     //dusman kontrol scriptine ulaştık
     dusman = GameObject.FindGameObjectWithTag("dusman").GetComponent <dusmanKontrol>();
     Fizik  = GetComponent <Rigidbody2D>();
     Fizik.AddForce(dusman.getYon() * 1000);
 }
コード例 #2
0
    void Start()
    {
        fizik  = GetComponent <Rigidbody2D>();
        dusman = transform.parent.GetComponent <dusmanKontrol>();
        fizik.AddForce(dusman.getYon() * 1000);
        float lazerYonDerece = Vector3.Angle(new Vector3(0.0f, 1.0f, 0.0f), dusman.getYon());


        if (dusman.getYon().x < 0.0f)
        {
            lazerYonDerece = -lazerYonDerece;
            lazerYonDerece = lazerYonDerece + 360;
        }

        transform.rotation = Quaternion.Euler(0, 0, -lazerYonDerece - 180);
    }
コード例 #3
0
 void Start()
 {
     kursun   = GameObject.FindGameObjectWithTag("kursun");
     ; dusman = GameObject.FindGameObjectWithTag("dusman").GetComponent <dusmanKontrol>();
     fizik    = GetComponent <Rigidbody2D>();
     fizik.AddForce(dusman.getYon() * 1000); // adforce vektor2 aliyor // dusman kontrol scriptinden getYonun vektorunu aldik, kursunun karaktere dogru gelmesini sagla
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     dusman = GameObject.FindGameObjectWithTag("dusman").GetComponent <dusmanKontrol>();
     fizik  = GetComponent <Rigidbody2D>();
     fizik.AddForce(dusman.getYon() * 1000);
 }