public override void OnInspectorGUI() { BaseAITeam myTarget = (BaseAITeam)target; base.OnInspectorGUI(); if (GUILayout.Button("Create Building")) { myTarget.ConstructBuilding(myTarget.TestSpawn, new Vector2(myTarget.x, myTarget.y)); } }
/// <summary> /// Not finished /// </summary> /// <param name="newTeam"></param> /// <param name="StartingPos"></param> /// <param name="TeamID"></param> public void AddTeam(TeamTypes newTeam, Vector2 StartingPos, int TeamID) { BaseAITeam nTeam = null;// = Instantiate(Resources.Load<BaseAITeam>("TeamPrefabs/BaseTeam")); switch (newTeam) { case TeamTypes.Utility: default: GameObject Temp = (GameObject)Instantiate(Resources.Load("TeamPrefabs/" + newTeam.ToString())); nTeam = Temp.GetComponent <BaseAITeam>(); break; } nTeam.StartingLocation = StartingPos; nTeam.TeamID = TeamID; nTeam.transform.SetParent(transform); Teams.Add(nTeam); }
public void RemoveTeam(BaseAITeam team) { DestroyImmediate(team.gameObject); TestTeams(); }