Пример #1
0
    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));
        }
    }
Пример #2
0
    /// <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);
    }
Пример #3
0
 public void RemoveTeam(BaseAITeam team)
 {
     DestroyImmediate(team.gameObject);
     TestTeams();
 }