Exemplo n.º 1
0
    /// <summary>
    ///
    /// </summary>
    public void RegisterSpawnPoint(bl_SpawnPoint point)
    {
        switch (point.m_Team)
        {
        case Team.Delta:
            DeltaSpawnPoint.Add(point.transform);
            break;

        case Team.Recon:
            ReconSpawnPoint.Add(point.transform);
            break;
        }
        AllSpawnPoints.Add(point.transform);
    }
Exemplo n.º 2
0
    void CreateSpawnPoint()
    {
        GameObject parent = GameObject.Find("SpawnPoints");

        if (parent == null)
        {
            parent = new GameObject("SpawnPoints");
            parent.transform.position = Vector3.zero;
        }
        if (SpawnTeam == Team.Delta)
        {
            GameObject t1p = GameObject.Find(string.Format("{0} Spawnpoints", bl_GameData.Instance.Team1Name));
            if (t1p == null)
            {
                t1p = new GameObject(string.Format("{0} Spawnpoints", bl_GameData.Instance.Team1Name));
                t1p.transform.parent        = parent.transform;
                t1p.transform.localPosition = Vector3.zero;
            }
            GameObject    spawn = new GameObject(string.Format("SpawnPoint [{0}]", bl_GameData.Instance.Team1Name));
            bl_SpawnPoint sp    = spawn.AddComponent <bl_SpawnPoint>();
            sp.m_Team = SpawnTeam;
            spawn.transform.parent = t1p.transform;
            Selection.activeObject = spawn;
            EditorGUIUtility.PingObject(spawn);
            var view = (SceneView)SceneView.sceneViews[0];
            spawn.transform.position = view.camera.transform.position + view.camera.transform.forward * 10;
        }
        else if (SpawnTeam == Team.Recon)
        {
            GameObject t1p = GameObject.Find(string.Format("{0} Spawnpoints", bl_GameData.Instance.Team2Name));
            if (t1p == null)
            {
                t1p = new GameObject(string.Format("{0} Spawnpoints", bl_GameData.Instance.Team2Name));
                t1p.transform.parent        = parent.transform;
                t1p.transform.localPosition = Vector3.zero;
            }
            GameObject    spawn = new GameObject(string.Format("SpawnPoint [{0}]", bl_GameData.Instance.Team2Name));
            bl_SpawnPoint sp    = spawn.AddComponent <bl_SpawnPoint>();
            sp.m_Team = SpawnTeam;
            spawn.transform.parent = t1p.transform;
            Selection.activeObject = spawn;
            EditorGUIUtility.PingObject(spawn);
            var view = (SceneView)SceneView.sceneViews[0];
            spawn.transform.position = view.camera.transform.position + view.camera.transform.forward * 10;
        }
        else
        {
            GameObject t1p = GameObject.Find(string.Format("{0} Spawnpoints", "ALL"));
            if (t1p == null)
            {
                t1p = new GameObject(string.Format("{0} Spawnpoints", "ALL"));
                t1p.transform.parent        = parent.transform;
                t1p.transform.localPosition = Vector3.zero;
            }
            GameObject    spawn = new GameObject(string.Format("SpawnPoint [{0}]", "ALL"));
            bl_SpawnPoint sp    = spawn.AddComponent <bl_SpawnPoint>();
            sp.m_Team = Team.All;
            spawn.transform.parent = t1p.transform;
            Selection.activeObject = spawn;
            EditorGUIUtility.PingObject(spawn);
            var view = (SceneView)SceneView.sceneViews[0];
            spawn.transform.position = view.camera.transform.position + view.camera.transform.forward * 10;
        }
    }
 /// <summary>
 ///
 /// </summary>
 /// <param name="point"></param>
 public static void UnRegisterSpawnPoint(bl_SpawnPoint point)
 {
     SpawnPoint.Remove(point);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="point"></param>
 public static void RegisterSpawnPoint(bl_SpawnPoint point)
 {
     SpawnPoint.Add(point);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="point"></param>
 public static void UnRegisterSpawnPoint(bl_SpawnPoint point)
 {
     SpawnPoint.Remove(point);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="point"></param>
 public static void RegisterSpawnPoint(bl_SpawnPoint point)
 {
     SpawnPoint.Add(point);
 }