void OnEnable() { //Store a reference to the AI Controller script manager = (CandiceAIManager)target; soTarget = new SerializedObject(manager); guiStyle.fontSize = 14; guiStyle.fontStyle = FontStyle.Bold; }
static bool ManagerExists() { bool isExists = false; GameObject[] arrGO = FindObjectsOfType <GameObject>(); int count = 0; while (!isExists && count < arrGO.Length) { GameObject go = arrGO[count]; CandiceAIManager aiManager = go.GetComponent <CandiceAIManager>(); if (aiManager != null) { isExists = true; } count++; } return(isExists); }