예제 #1
0
    void GetServerAdd(string selected, byte[] data, string team, string typeObj)
    {
        MemoryStream    m     = new MemoryStream(data);
        BinaryFormatter b     = new BinaryFormatter();
        ScenarioEditor  temp  = new ScenarioEditor();
        Point           point = (Point)b.Deserialize(m);
        ObjectFactory   unit  = new ObjectFactory();
        int             type  = Convert.ToInt32(typeObj);
        GameObject      gameObjectToAdd;

        if (type == 0)
        {
            gameObjectToAdd = unit.LoadAir(selected);
        }
        else if (type == 1)
        {
            gameObjectToAdd = unit.LoadMarine(selected);
        }
        else if (type == 2)
        {
            gameObjectToAdd = unit.LoadSubSurface(selected);
        }
        else
        {
            gameObjectToAdd = unit.LoadSurface(selected);
        }
        gameObjectToAdd.GetComponent <IdentityController> ().TeamNumber = Convert.ToInt32(team);
        gameObjectToAdd.transform.localPosition = new Vector3(point.x, point.y);
    }
예제 #2
0
 private void Awake()
 {
     Instance = this;
 }
예제 #3
0
        public void ShowPropertyEditor(IWin32Window current)
        {
            ScenarioEditor ed = new ScenarioEditor(m_scenarios);

            ed.ShowDialog(current); // TODO: capture results, and load the returned list
        }