This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class characterController : MonoBehaviour { | |
| public float speed = 10f; //Karakter hızı | |
| public float jPower = 5f; //Zıplama gücü | |
| Rigidbody rb; | |
| void Start () { | |
| Cursor.lockState = CursorLockMode.Locked;//Mouseyi kilitleme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.UI; | |
| public class mouseLook : MonoBehaviour { | |
| Vector2 mLook; | |
| Vector2 smoothV; | |
| public float hassaslik = 5.0f; | |
| public float smoothing = 2.0f; | |
| GameObject character; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class Shoot : MonoBehaviour { | |
| public GameObject cam; | |
| RaycastHit hit; | |
| public float range = 300f; | |
| public int bulletForce = 10; | |
| public GameObject bullet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class moveObject : MonoBehaviour { | |
| //private GameObject item; | |
| public GameObject tempParent; | |
| public GameObject mGuide; | |
| private Rigidbody rb; | |
| private Transform oldParent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class animalAI : MonoBehaviour { | |
| public float cSec = 3.0f; //Kaç saniyede bir bu kontrolleri falan yapsın diye yazdığım bir değer. | |
| public float waitFor = 3.0f; | |
| public int canliSira; | |
| private float ne_Tarafa; | |
| private float ne_Kadar; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class animalAI : MonoBehaviour { | |
| public float cSec = 3.0f; //Kaç saniyede bir bu kontrolleri falan yapsın diye yazdığım bir değer. | |
| public float waitFor = 3.0f; | |
| public int canliSira; | |
| private float ne_Tarafa; | |
| private float ne_Kadar; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| /* | |
| Hayvanın hareketini yapması ve hayvan hareket ederken hareket bitene kadar yapay zekanın başka hareket yapmaması gerekiyor. | |
| Hayvanın hareketinin bittiğini ve bırakması gerektiğini anlamamız için de gitmesi gereken noktayı bulmalıyız. | |
| Bu nokta ile şuanki bulunduğu nokta arası uzaklığı sürekli kontrol edip bu uzaklık 0 olduğunda hayvanın hareketini kesmesi gerektiğini anlamalıyız. | |
| Ancak sıkıntılar burada başlıyor. | |
| Hayvanı sürekli forward da hareket ettirdiğimiz için mesela 90 ve 270 derece rotasyonda hayvanın yeri değişse de pozisyon bilgisi değişmiyor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| /* | |
| Hayvanın hareketini yapması ve hayvan hareket ederken hareket bitene kadar yapay zekanın başka hareket yapmaması gerekiyor. | |
| Hayvanın hareketinin bittiğini ve bırakması gerektiğini anlamamız için de gitmesi gereken noktayı bulmalıyız. | |
| Bu nokta ile şuanki bulunduğu nokta arası uzaklığı sürekli kontrol edip bu uzaklık 0 olduğunda hayvanın hareketini kesmesi gerektiğini anlamalıyız. | |
| Ancak sıkıntılar burada başlıyor. | |
| Hayvanı sürekli forward da hareket ettirdiğimiz için mesela 90 ve 270 derece rotasyonda hayvanın yeri değişse de pozisyon bilgisi değişmiyor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class newAI : MonoBehaviour{ | |
| public float speed = 2; | |
| public float directionChangeInterval = 4; | |
| float heading; | |
| public float min_Donme = 9f; | |
| public float maks_Donme = 89f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class animalAI : MonoBehaviour { | |
| public float distance = 10f; | |
| private Vector3 cPos; //Current Position | |
| public float speed = 4.0f; | |
| private Vector3 targetPos; | |
| private bool waitformove = false; |