PRİSONER SCRİPTİ BAŞLANGIÇ: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; using UnityEngine.UI; using TMPro; using System.IO; public class Prisoner : MonoBehaviour { // Başlangıçta var olan kodlar [Header("DEGERLER")] public string Prisoner_Name; [Header("CANVAS")] public GameObject canvasObject; public TextMeshProUGUI Prisoner_Name_TXT; public float AIGecisSure; public static List allPrisoners = new List(); void Awake() { allPrisoners.Add(this); } private void Start() { HappyCheckFirstTime(); HungryCheckFirstTime(); ComfortCheckFirstTime(); YapayZekaStart(); mainPrison = gameObject.GetComponent(); } private void Update() { #region PLAYER PREFS Happy = PlayerPrefs.GetFloat(Prisoner_Name + "Happy"); Hungry = PlayerPrefs.GetFloat(Prisoner_Name + "Hungry"); Comfort = PlayerPrefs.GetFloat(Prisoner_Name + "Comfort"); #endregion #region VARIABLE TO TEXT Prisoner_Name_TXT.text = Prisoner_Name.ToString(); #endregion #region HAPPY UPDATE if (HappyisFirstTime) { SetRandomHappyValue(); HappyisFirstTime = false; } HappyCount.value = Happy; if (Happy >= 0f && Happy < 0.6f) { float normalizedValue = Mathf.InverseLerp(0f, 0.6f, Happy); HappyCount_Fill_IMG.color = Color.Lerp(RedColor, OrangeColor, normalizedValue); } else if (Happy >= 0.6f && Happy <= 1f) { float normalizedValue = Mathf.InverseLerp(0.6f, 1f, Happy); HappyCount_Fill_IMG.color = Color.Lerp(OrangeColor, GreenColor, normalizedValue); } #endregion #region HUNGRY UPDATE if (HungryisFirstTime) { SetRandomHungryValue(); HungryisFirstTime = false; } HungryCount.value = Hungry; if (Hungry >= 0f && Hungry < 0.6f) { float normalizedValue = Mathf.InverseLerp(0f, 0.6f, Hungry); HungryCount_Fill_IMG.color = Color.Lerp(RedColor, OrangeColor, normalizedValue); } else if (Hungry >= 0.6f && Hungry <= 1f) { float normalizedValue = Mathf.InverseLerp(0.6f, 1f, Hungry); HungryCount_Fill_IMG.color = Color.Lerp(OrangeColor, GreenColor, normalizedValue); } #endregion #region COMFORT UPDATE if (ComfortisFirstTime) { SetRandomComfortValue(); ComfortisFirstTime = false; } ComfortCount.value = Comfort; if (Comfort >= 0f && Comfort < 0.6f) { float normalizedValue = Mathf.InverseLerp(0f, 0.6f, Comfort); ComfortCount_Fill_IMG.color = Color.Lerp(RedColor, OrangeColor, normalizedValue); } else if (Comfort >= 0.6f && Comfort <= 1f) { float normalizedValue = Mathf.InverseLerp(0.6f, 1f, Comfort); ComfortCount_Fill_IMG.color = Color.Lerp(OrangeColor, GreenColor, normalizedValue); } #endregion #region YAPAY ZEKA UPDATE YapayZekaUpdate(); #region YATAK if (isSleeping) { if (YatakAlindi) { navMesh.SetDestination(Bed_Level_1_Point.position); } else { navMesh.SetDestination(Bed_Level_2_Point.position); } if (YatakAlindi) { if (hedefDistance < 0.2f) { blokManager.Bed_1_Online = true; navMesh.speed = 0; AIGecisSure += Time.deltaTime; if (AIGecisSure > 0.1f) { Vector3 targetPosition = Bed_Level_1_Point.position; Quaternion targetRotation = Bed_Level_1_Point.rotation; // Pozisyonu ve rotasyonu yavaşça hedefe yaklaşacak şekilde geçiş yap gameObject.transform.position = targetPosition; gameObject.transform.rotation = targetRotation; SleepingVFX.SetActive(true); } } else { AIGecisSure = 0; SleepingVFX.SetActive(false); } } else { if (hedefDistance < 0.2f) { navMesh.speed = 0; AIGecisSure += Time.deltaTime; if (AIGecisSure > 0.1f) { Vector3 targetPosition = Bed_Level_2_Point.position; Quaternion targetRotation = Bed_Level_2_Point.rotation; // Pozisyonu ve rotasyonu yavaşça hedefe yaklaşacak şekilde geçiş yap gameObject.transform.position = targetPosition; gameObject.transform.rotation = targetRotation; SleepingVFX.SetActive(true); } } else { AIGecisSure = 0; SleepingVFX.SetActive(false); } } } #endregion #region TUVALET if (isToilet) { if (blokManager.toiletManager.isOnline) { if (MahkumToiletOnline == false) { if (blokManager.Toilet_Waiting_Point_1_isOnline == false) { navMesh.SetDestination(blokManager.Toilet_Waiting_Point_1.position); anim.SetFloat("Movement", 0); blokManager.Toilet_Waiting_Point_1_isOnline = true; } else { navMesh.SetDestination(blokManager.Toilet_Waiting_Point_2.position); anim.SetFloat("Movement", 0); } } else { navMesh.SetDestination(Toilet_Point.position); if (hedefDistance < 0.1f) { AIGecisSure += Time.deltaTime; if (AIGecisSure > 0.1f) { Vector3 targetPosition = Toilet_Point.position; Quaternion targetRotation = Toilet_Point.rotation; // Pozisyonu ve rotasyonu yavaşça hedefe yaklaşacak şekilde geçiş yap gameObject.transform.position = targetPosition; gameObject.transform.rotation = targetRotation; } } } } else { navMesh.SetDestination(Toilet_Point.position); if (hedefDistance < 0.1f) { AIGecisSure += Time.deltaTime; if (AIGecisSure > 0.1f) { Vector3 targetPosition = Toilet_Point.position; Quaternion targetRotation = Toilet_Point.rotation; // Pozisyonu ve rotasyonu yavaşça hedefe yaklaşacak şekilde geçiş yap gameObject.transform.position = targetPosition; gameObject.transform.rotation = targetRotation; } } } } #endregion #endregion } #region HAPPY #region HAPPY COMPONENTS [Header("HAPPY VARIABLES")] public float Happy; public Slider HappyCount; public Image HappyCount_Fill_IMG; private bool HappyisFirstTime = true; [Header("UI COLORS")] public Color RedColor; public Color OrangeColor; public Color GreenColor; #endregion private void HappyCheckFirstTime() { if (PlayerPrefs.HasKey(Prisoner_Name + "Happy")) { HappyisFirstTime = false; } } private void SetRandomHappyValue() { float randomValue = Random.Range(0.1f, 0.65f); PlayerPrefs.SetFloat(Prisoner_Name + "Happy", randomValue); Happy = randomValue; } #endregion #region HUNGRY #region HAPPY COMPONENTS [Header("HAPPY VARIABLES")] public float Hungry; public Slider HungryCount; public Image HungryCount_Fill_IMG; private bool HungryisFirstTime = true; #endregion private void HungryCheckFirstTime() { if (PlayerPrefs.HasKey(Prisoner_Name + "Hungry")) { HungryisFirstTime = false; } } private void SetRandomHungryValue() { float randomValue = Random.Range(0.1f, 0.65f); PlayerPrefs.SetFloat(Prisoner_Name + "Hungry", randomValue); Hungry = randomValue; } #endregion #region COMFORT #region HAPPY COMPONENTS [Header("HAPPY VARIABLES")] public float Comfort; public Slider ComfortCount; public Image ComfortCount_Fill_IMG; private bool ComfortisFirstTime = true; #endregion private void ComfortCheckFirstTime() { if (PlayerPrefs.HasKey(Prisoner_Name + "Comfort")) { ComfortisFirstTime = false; } } private void SetRandomComfortValue() { float randomValue = Random.Range(0.1f, 0.65f); PlayerPrefs.SetFloat(Prisoner_Name + "Comfort", randomValue); Comfort = randomValue; } #endregion #region YAPAY ZEKA #region YAPAY ZEKA COMPONENTLER [Header("REQUIRED COMPONENTS")] public Animator anim; public NavMeshAgent navMesh; public Prisoner mainPrison; public Blok_Manager blokManager; [Header("BOOLEANS")] public bool isSleeping; public bool isToilet; public bool isWashing; public bool canToilet; bool MahkumToiletOnline; public bool YatakAlindi; [Header("OBJECTS")] public GameObject Dus_Blur; public GameObject SleepingVFX; [Header("POINTS")] public Transform Toilet_Point; public Transform Bed_Level_1_Point; public Transform Bed_Level_2_Point; [Header("FLOATS")] public float hedefDistance; float AIGecisSuresi; float AIGecisSuresiTuvalet; public float toiletCountTime; float randomGecis; #endregion public void YapayZekaStart() { Toilet_Point = blokManager.Toilet_Position; Bed_Level_1_Point = blokManager.Bed_Level_1_Position; Bed_Level_2_Point = blokManager.Bed_Level_2_Position; anim = GetComponent(); navMesh = GetComponent(); mainPrison = GetComponent(); randomGecis = Random.Range(0.1f, 0.5f); YatagiAl(); } public void YapayZekaUpdate() { #region YATAK if (GameManager.manager.Sleep) { isSleeping = true; } else { isSleeping = false; } #endregion #region TUVALET if (canToilet == false) { if (GameManager.manager.Toilet) { isToilet = true; } } else { isToilet = false; } if (anim.GetBool("isToilet")) { toiletCountTime += Time.deltaTime; MahkumToiletOnline = true; blokManager.toiletManager.isOnline = true; if (toiletCountTime > 9.5f) { canToilet = true; navMesh.ResetPath(); characterState = CharacterState.Idle; blokManager.toiletManager.isOnline = false; blokManager.Toilet_Waiting_Point_1_isOnline = false; } } #endregion #region DUS if (GameManager.manager.Washing) { UpdateDusState(); if (dusBitti == false) { isWashing = true; } else { isWashing = false; } } #endregion #region YEMEK if (GameManager.manager.Breakfast) { // Yemek zamanı, yemek almaya git isSleeping = false; isToilet = false; isWashing = false; UpdateYemekState(); } #endregion #region AUTO MOVEMENT & FOLLOW if (navMesh.destination != null) { hedefDistance = Vector3.Distance(mainPrison.gameObject.transform.position, navMesh.destination); if (hedefDistance > 0.3f) { navMesh.speed = 2.5f; if (GameManager.manager.Breakfast == false) { anim.SetFloat("Movement", 1); } } else { anim.SetFloat("Movement", 0); } } else { hedefDistance = 5; anim.SetFloat("Movement", 0); } #region YATAK if (isSleeping) { if (hedefDistance < 0.1f) { navMesh.speed = 0; AIGecisSuresi += Time.deltaTime; if (AIGecisSuresi > randomGecis) { anim.SetBool("isSleeping", true); } } canToilet = false; toiletCountTime = 0; } else { anim.SetBool("isSleeping", false); } #endregion #region TUVALET if (isToilet) { AIGecisSuresiTuvalet += Time.deltaTime; if (AIGecisSuresiTuvalet > randomGecis) { UseToilet(); } } else { AIGecisSuresiTuvalet = 0; anim.SetBool("isToilet", false); } #endregion /* if (!isSleeping && !isToilet && !isWashing && !GameManager.manager.Breakfast==false) { if (dusBitti == false) { navMesh.speed = 0; anim.SetFloat("Movement", 0); AIGecisSuresi = 0; } } */ #endregion if (Input.GetKeyDown(KeyCode.L)) { Time.timeScale = 2f; } if (Input.GetKeyDown(KeyCode.O)) { Time.timeScale = 1f; } } #region YATAK VOIDS public void YatagiAl() { if (YatakAlindi == false) { if (blokManager.Bed_1_Online == false) { YatakAlindi = true; blokManager.Bed_1_Online = true; } } } #endregion #region TUVALET VOIDS public void UseToilet() { // Mahkumun tuvaleti kullanmaya başlamasını sağla // Bu kısım mahkumun tuvalete oturduğunu gösteren animasyonları tetikleyebilir, vb. if (isToilet) { if (hedefDistance < 0.1f) { if (blokManager.toiletManager.isOnline == false) { navMesh.speed = 0; if (hedefDistance < 0.05) { anim.SetBool("isToilet", true); } } else { navMesh.speed = 0; } } } } #endregion public CharacterState characterState; public bool dusBitti; bool dusTamamenBitti; int kullanilanDus; float tuvaletGecisSure; [Header("YEMEKHANE AYARLARI")] public int kullanilanSira; public int kullanilanBeklemeSirasi; public int priority; public bool hasEaten = false; public GameObject EmptyTabldot; public GameObject FoodObject; public void UpdateDusState() { if (GameManager.manager.Breakfast == false) { if (isSleeping == false) { if (isToilet == false) { if (dusTamamenBitti == false) { switch (characterState) { #region DUS #region DUS KONTROLU case CharacterState.Idle: if (GameManager.manager.Washing) { if (dusBitti == false) { // Karakter boşta, bir Dus noktasına gitmeye çalış for (int i = 0; i < Dus_Manager.dusManager.Dus_isOnline.Count; i++) { if (!Dus_Manager.dusManager.Dus_isOnline[i]) { navMesh.SetDestination(Dus_Manager.dusManager.Dus_Points[i].position); Dus_Manager.dusManager.Dus_isOnline[i] = true; kullanilanDus = i; characterState = CharacterState.MovingToDus; return; } } // Tüm Dus noktaları dolu, bir Sira noktasına git for (int i = 0; i < Dus_Manager.dusManager.Sira_isOnline.Count; i++) { if (!Dus_Manager.dusManager.Sira_isOnline[i]) { navMesh.SetDestination(Dus_Manager.dusManager.Sira_Points[i].position); Dus_Manager.dusManager.Sira_isOnline[i] = true; kullanilanSira = i; characterState = CharacterState.MovingToSira; return; } } } else { for (int i = 0; i < Dus_Manager.dusManager.Sira_isOnline.Count; i++) { if (!Dus_Manager.dusManager.Sira_isOnline[i]) { navMesh.speed = 2.5f; // normalSpeed, karakterin normal hızı olmalıdır. navMesh.SetDestination(Dus_Manager.dusManager.Sira_Points[i].position); Dus_Manager.dusManager.Sira_isOnline[i] = true; characterState = CharacterState.MovingToSira; return; } } } } break; #endregion #region DUSA GIDIS case CharacterState.MovingToDus: // Karakter bir Dus noktasına gidiyor, ulaştığında beklemeye başla if (hedefDistance < 0.1f) { navMesh.speed = 0; anim.SetFloat("Movement", 0); characterState = CharacterState.WaitingAtDus; } break; #endregion #region DUS DA BEKLEME case CharacterState.WaitingAtDus: if (dusBitti == false) { Dus_Blur.SetActive(true); anim.SetBool("isWashing", true); tuvaletGecisSure += Time.deltaTime; if (tuvaletGecisSure > 10f) // 10 saniye bekledikten sonra { anim.SetBool("isWashing", false); isWashing = false; dusBitti = true; dusTamamenBitti = true; characterState = CharacterState.GettingFood; Dus_Manager.dusManager.Dus_isOnline[kullanilanDus] = false; tuvaletGecisSure = 0; Dus_Blur.SetActive(false); // Find a vacant Sira_Point and go there for (int i = 0; i < Dus_Manager.dusManager.Sira_isOnline.Count; i++) { if (!Dus_Manager.dusManager.Sira_isOnline[i]) { navMesh.speed = 2.5f; // normalSpeed, karakterin normal hızı olmalıdır. navMesh.SetDestination(Dus_Manager.dusManager.Sira_Points[i].position); Dus_Manager.dusManager.Sira_isOnline[i] = true; characterState = CharacterState.MovingToSira; return; } } characterState = CharacterState.Idle; } } // Karakter bir Dus noktasında bekliyor, belirli bir süre bekledikten sonra tekrar boşta ol break; #endregion #region DUS SIRASINA GIDIS case CharacterState.MovingToSira: // Karakter bir Sira noktasına gidiyor, ulaştığında beklemeye başla if (hedefDistance < 0.1f) { anim.SetFloat("Movement", 0); navMesh.speed = 0; characterState = CharacterState.WaitingAtSira; } else { anim.SetFloat("Movement", 1); } break; #endregion #region DUS SIRASI BEKLEME case CharacterState.WaitingAtSira: // Karakter bir Sira noktasında bekliyor, bir Dus noktası boşaldığında tekrar boşta ol for (int i = 0; i < Dus_Manager.dusManager.Dus_isOnline.Count; i++) { if (!Dus_Manager.dusManager.Dus_isOnline[i]) { Dus_Manager.dusManager.Sira_isOnline[kullanilanSira] = false; characterState = CharacterState.Idle; return; } } break; #endregion #endregion } } } } } } public void UpdateYemekState() { if (GameManager.manager.Breakfast) { switch (characterState) { case CharacterState.Idle: if (!Yemekhane_Manager.yemekhaneManager.FoodOnline) { navMesh.SetDestination(Yemekhane_Manager.yemekhaneManager.Food_Take_Point.position); Yemekhane_Manager.yemekhaneManager.FoodOnline = true; anim.SetFloat("Movement", 1); characterState = CharacterState.GettingFood; } else { for (int i = 0; i < Yemekhane_Manager.yemekhaneManager.Sira_isOnline.Count; i++) { if (!Yemekhane_Manager.yemekhaneManager.Sira_isOnline[i]) { navMesh.SetDestination(Yemekhane_Manager.yemekhaneManager.Sira_Points[i].position); Yemekhane_Manager.yemekhaneManager.Sira_isOnline[i] = true; anim.SetFloat("Movement", 1); kullanilanSira = i; kullanilanBeklemeSirasi = i; characterState = CharacterState.MovingToSira; return; } } } break; case CharacterState.MovingToSira: if (hedefDistance < 0.2f) { anim.SetFloat("Movement", 0); characterState = CharacterState.WaitingAtSira; } break; case CharacterState.WaitingAtSira: // Sadece öncelikli mahkum hareket eder. if (this.priority == Prisoner.GetHighestPriority() && Yemekhane_Manager.yemekhaneManager.FoodOnline == false) { navMesh.SetDestination(Yemekhane_Manager.yemekhaneManager.Prison_Food_Take_Point.position); Yemekhane_Manager.yemekhaneManager.FoodOnline = true; anim.SetFloat("Movement", 1); characterState = CharacterState.MovingToFood; } else { if (hedefDistance < 0.1f) { navMesh.SetDestination(Yemekhane_Manager.yemekhaneManager.Sira_Points[kullanilanBeklemeSirasi].position); navMesh.speed = 0; anim.SetFloat("Movement", 0); anim.SetFloat("Food_Movement", 0); } else { anim.SetFloat("Movement", 1); navMesh.speed = 1; navMesh.SetDestination(Yemekhane_Manager.yemekhaneManager.Sira_Points[kullanilanBeklemeSirasi].position); } } break; case CharacterState.MovingToFood: if (Yemekhane_Manager.yemekhaneManager.FoodOnline == false) { navMesh.SetDestination(Yemekhane_Manager.yemekhaneManager.Prison_Food_Take_Point.position); if (Vector3.Distance(transform.position, Yemekhane_Manager.yemekhaneManager.Prison_Food_Take_Point.position) < 0.1f) { //EmptyTabldot.SetActive(true); // Tabldot alınıyor navMesh.speed = 2.5f; Yemekhane_Manager.yemekhaneManager.FoodOnline = true; anim.SetFloat("Food_Movement", 1); characterState = CharacterState.GettingFood; } else { anim.SetFloat("Movement", 1); } } else { characterState = CharacterState.WaitingAtSira; } break; case CharacterState.GettingFood: if (FoodStack.foodManager.isHaveFood) { for (int i = 0; i < Yemekhane_Manager.yemekhaneManager.Oturma_Points.Count; i++) { if (!Yemekhane_Manager.yemekhaneManager.YemekSira_isOnline[i]) { anim.SetFloat("Movement", 0); anim.SetFloat("Food_Movement", 1); EmptyTabldot.SetActive(true); hasEaten = true; FoodStack.foodManager.RemoveFood(); Yemekhane_Manager.yemekhaneManager.FoodOnline = false; YemekSiraEksiltme(); navMesh.speed = 1f; navMesh.SetDestination(Yemekhane_Manager.yemekhaneManager.Oturma_Points[i].position); kullanilanSira = i; Yemekhane_Manager.yemekhaneManager.YemekSira_isOnline[i] = true; characterState = CharacterState.MovingToSeat; return; } } } if (hedefDistance > 0.4f) { anim.SetFloat("Movement", 1); } else { if (FoodStack.foodManager.isHaveFood == false) { EmptyTabldot.SetActive(false); anim.SetFloat("Movement", 0); anim.SetFloat("Food_Movement", 0); navMesh.speed = 0; } } break; case CharacterState.MovingToSeat: anim.SetFloat("Movement", 0); if (hedefDistance < 2f) { characterState = CharacterState.Eating; anim.SetFloat("Movement", 0); anim.SetFloat("Food_Movement", 0); navMesh.speed = 2.5f; } break; case CharacterState.Eating: if (hedefDistance < 2f) { navMesh.speed = 0f; EmptyTabldot.SetActive(false); // Tabldot alınıyor FoodObject.SetActive(true); anim.SetBool("isEating", true); // Eating animasyonunu çalıştır anim.SetFloat("Food_Movement", 0); Vector3 targetPosition = Yemekhane_Manager.yemekhaneManager.Oturma_Points[kullanilanSira].position; Quaternion targetRotation = Yemekhane_Manager.yemekhaneManager.Oturma_Points[kullanilanSira].rotation; // Pozisyonu ve rotasyonu yavaşça hedefe yaklaşacak şekilde geçiş yap gameObject.transform.position = targetPosition; gameObject.transform.rotation = targetRotation; } break; } } else { EmptyTabldot.SetActive(false); FoodObject.SetActive(false); } } public static int GetHighestPriority() { int minPriority = int.MaxValue; foreach (Prisoner prisoner in allPrisoners) { if (!prisoner.hasEaten && prisoner.priority < minPriority) { minPriority = prisoner.priority; } } return minPriority; } public void YemekSiraEksiltme() { // Tüm Prisoner scriptine sahip GameObject'leri bul Prisoner[] prisoners = FindObjectsOfType(); // Her bir Prisoner için kullanilanSira değerini -1 yap foreach (Prisoner prisoner in prisoners) { prisoner.kullanilanBeklemeSirasi -= 1; //prisoner.kullanilanSira -= 1; // prisoner.priority -= 1; } } #endregion } public enum CharacterState { Idle, MovingToDus, WaitingAtDus, MovingToSira, WaitingAtSira, GettingFood, MovingToSeat, Eating, MovingToFood } PRİSONER SCRİPTİ BİTİŞ GAME MANAGER SCRİPTİ BAŞLANGIÇ: using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameManager : MonoBehaviour { public static GameManager manager; // Diğer etkinlik kuyruklarını da burada tanımlayabilirsiniz. private void Awake() { manager = this; } private void Update() { TimeUpdate(); Period_Update(); } #region PERIOD public bool Sleep; public bool Toilet; public bool Washing; public bool Breakfast; public bool Spor; public bool Maden; public void Period_Update() { Sleep = Hour >= 0f && Hour < 6.5f; Toilet = Hour >= 7f && Hour < 8f; Washing = (Hour >= 8f && Hour < 9f) || (Hour >= 13.5f && Hour < 15.5f) || (Hour >= 20f && Hour < 22f); Breakfast = Hour >= 9f && Hour < 11.5f || (Hour >= 22f && Hour < 24f); Spor = Hour >= 11.5f && Hour < 13.5f; Maden = Hour >= 15.5f && Hour < 20f; } #endregion #region TIME public float Hour; public float Minute; public float minuteSave; public bool ZAMANI_KONTROL_ET; public void TimeUpdate() { if (ZAMANI_KONTROL_ET) { Hour = PlayerPrefs.GetFloat("Hour"); Minute = PlayerPrefs.GetFloat("Minute"); PlayerPrefs.SetFloat("Hour", minuteSave); } else { Hour = PlayerPrefs.GetFloat("Hour"); Minute = PlayerPrefs.GetFloat("Minute"); minuteSave += Time.deltaTime / 2; if (minuteSave > 0.5f) { PlayerPrefs.SetFloat("Minute", PlayerPrefs.GetFloat("Minute") + 1); minuteSave = 0; } if (Minute > 59) { PlayerPrefs.SetFloat("Hour", PlayerPrefs.GetFloat("Hour") + 1); PlayerPrefs.SetFloat("Minute", 0); } if (Hour > 23) { PlayerPrefs.SetFloat("Hour", 0); } } } #endregion } GAME MANAGER SCRIPTI BİTİŞ GYM MANAGER SCRİPTİ BAŞLANGIÇ: using System.Collections; using System.Collections.Generic; using UnityEngine; public class GYM_Manager : MonoBehaviour { public static GYM_Manager gymManager; public List Sira_Points = new List(); public Transform ZiplamaPoint; public Transform SquadPoint; public Transform RunMachinePoint; public Transform YerdeZiplamaPoint; public Transform KumTorbasiPoint; public Transform AgirlikPoint; public List Sira_isOnline = new List(); public bool isOnlineZiplama; public bool isOnlineSquad; public bool isOnlineRunMachine; public bool isOnlineYerdeZiplama; public bool isOnlineKumTorbasi; public bool isOnlineAgirlik; public GameObject Agirlik; private void Awake() { gymManager = this; } } /* * Prisoner Animasyon Bool Parametleri * GYM-isZiplama Bu Ziplama animasyonu * GYM-isSquad Bu Squad Animasyonu * GYM-isYerdeZiplama Bu yerde Ziplama animasyonu * GYM-isRunMachine Bu Koşu makinesi Animasyonu * GYM-isKumTorbasi Bu kum torbası animasyonu * GYM-isAgirlik bu ağırlık kaldırma animasyonu (Burada "Fake_Agirlik" adinda bir GameObject setActive True olacak ve "Agirlik" GameObjecti False olacakEğer ağırlık işin yapmıyorsa Tam tersi olacak.) */ GYM MANAGER SCRIPTI BİTİŞ.