static public void Tester() { //Creating and setting the position of the pop up window ComponentAlert window = ScriptableObject.CreateInstance <ComponentAlert>(); window.position = new Rect(Screen.width / 0.4f, Screen.height / 1.5f, 300, 200); window.ShowPopup(); }
// Adds Navmeshagent, Rigidbody, Pathmanager, NavMeshHandler and any other scripts that have been selected void AddComponents() { Debug.Log(amountOfHealth); if (wonder == false & chasePlayer == false && playerDection == false && healthManager == false && attachComponents == false) { ComponentAlert.Tester(); } if (aiObject.GetComponent <PathManager>() == null) { aiObject.AddComponent <PathManager>(); } if (wonder == true && aiObject.GetComponent <Wonder>() == null) { aiObject.AddComponent <Wonder>(); } if (lookAround == true && aiObject.GetComponent <LookAround>() == null) { aiObject.AddComponent <LookAround>(); } if (chasePlayer == true && aiObject.GetComponent <ChasePlayer>() == null) { aiObject.AddComponent <ChasePlayer>(); } if (playerDection == true && aiObject.GetComponent <PlayerDetection>() == null) { aiObject.AddComponent <PlayerDetection>(); } if (healthManager == true && aiObject.GetComponent <Health>() == null) { aiObject.AddComponent <Health>(); } if (aiObject.GetComponent <NavMeshAgent>() == null) { aiObject.AddComponent <NavMeshAgent>(); } if (aiObject.GetComponent <Rigidbody>() == null) { aiObject.AddComponent <Rigidbody>(); } if (aiObject.GetComponent <NavMeshHandler>() == null) { aiObject.AddComponent <NavMeshHandler>(); } }