Пример #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (MapEditorMain game = new MapEditorMain())
     {
         game.Run();
     }
 }
Пример #2
0
        // Use this for initialization
        void Start()
        {
            Instance      = this;
            fileDirectory = Application.dataPath + "/Data/";

            deployableTypeDictionary = new Dictionary <Deployable.DeployableType, Deployable> ();
            DeployableList.Reverse();
            foreach (Deployable deployableObject in DeployableList)
            {
                deployableTypeDictionary.Add(deployableObject.GetDeployableType(), deployableObject);

                // dynamically create deployable buttons
                GameObject newButton = (GameObject)Instantiate(DeployableButton);
                newButton.transform.SetParent(DeployableButtonParent);
                newButton.GetComponentInChildren <Text> ().text = deployableObject.GetDeployableType().ToString();

                Button button = newButton.GetComponent <Button> ();
                // this temp variable is useful in this foreach block
                Deployable deployableTemp = deployableObject;
                button.onClick.AddListener(() => OnDeployableButtonClick(deployableTemp, button));
            }

            layerToSelectDictionary = new Dictionary <int, Deployable.DeployLayer> ();
            layerToSelectDictionary.Add(0, Deployable.DeployLayer._Null);
            layerToSelectDictionary.Add(1, Deployable.DeployLayer._WalkableLayer);
            layerToSelectDictionary.Add(2, Deployable.DeployLayer._BuildableLayer);
            layerToSelectDictionary.Add(3, Deployable.DeployLayer._GameObjectLayer);
        }