public static void AddFormationManager() { FormationManager exists = (FormationManager)FindObjectOfType <FormationManager>(); if (!exists) { GameObject mngr = new GameObject("Formation Manager"); if (mngr) { mngr.transform.position = new Vector3(0, 0, 0); mngr.AddComponent <FormationManager>(); } } else { Debug.LogWarning("A Formation Manager already exists in the Hierarchy"); } }
public void OnEnable() { formationManager = target as FormationManager; }