Esempio n. 1
0
        public void Initialize(NewGameController controller)
        {
            this.controller = controller;

            int selectedIndex = 0;

            foreach (var mapFactory in MapAssets.StarPositioners)
            {
                if (controller.StarPositioner == mapFactory)
                {
                    selectedIndex = shapeSelector.Items.Count;
                }
                shapeSelector.Items.Add(new Tag <IStarPositioner>(mapFactory, mapFactory.Name));
            }
            shapeSelector.SelectedIndex = selectedIndex;
            shapeSelector.Visible       = MapAssets.StarPositioners.Length > 1;

            selectedIndex = 0;
            foreach (var wormholeFactory in MapAssets.StarConnectors)
            {
                if (controller.StarConnector == wormholeFactory)
                {
                    selectedIndex = wormholeSelector.Items.Count;
                }
                wormholeSelector.Items.Add(new Tag <IStarConnector>(wormholeFactory, wormholeFactory.Name));
            }
            wormholeSelector.SelectedIndex = selectedIndex;
            wormholeSelector.Visible       = MapAssets.StarConnectors.Length > 1;

            selectedIndex = 0;
            foreach (var populatorFactory in MapAssets.StarPopulators)
            {
                if (controller.StarConnector == populatorFactory)
                {
                    selectedIndex = populatorSelector.Items.Count;
                }
                populatorSelector.Items.Add(new Tag <IStarPopulator>(populatorFactory, populatorFactory.Name));
            }
            populatorSelector.SelectedIndex = selectedIndex;
            populatorSelector.Visible       = MapAssets.StarPopulators.Length > 1;
        }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     ngc = GameObject.Find("GameController").GetComponent <NewGameController>();
 }
Esempio n. 3
0
 void Awake()
 {
     myToggle            = GetComponent <Toggle>();
     myNewGameController = NewGamePanel.GetComponent <NewGameController>();
 }
 //public GameObject gamecontroller;
 // Use this for initialization
 void Start()
 {
     GameCont = GameObject.FindGameObjectWithTag("GameController").GetComponent <NewGameController> ();
     //print ("GameCont : " + GameCont.clickturn);
 }