コード例 #1
0
        void Start()
        {
            ui_manager = Object.FindObjectOfType <ListController>();

            harvesterUiElement = ui_manager.AddUiElement(
                Resources.Load <Sprite>("Sprites/" + component.harvesterPrototype),
                component.harvesterPrototype,
                cancel => {});
            wizardUiElement = ui_manager.AddUiElement(
                Resources.Load <Sprite>("Sprites/" + component.wizardPrototype),
                component.wizardPrototype,
                cancel => {});
        }
コード例 #2
0
ファイル: TruckMirror.cs プロジェクト: rbarraud/blarg4
        void Start()
        {
            testshit   = Object.FindObjectOfType <Testshit>();
            ui_manager = Object.FindObjectOfType <ListController>();

            deployUiElement = ui_manager.AddUiElement(
                Resources.Load <Sprite>("Sprites/" + component.deployPrototype),
                component.deployPrototype,
                cancel => {
                if (!cancel)
                {
                    testshit.DeployCommand(GetComponent <EntityMirror>(),
                                           // Truck deploys in place.
                                           Vector3.zero);
                }
            });
        }
コード例 #3
0
ファイル: WizardMirror.cs プロジェクト: rbarraud/blarg4
        void Start()
        {
            testshit   = Object.FindObjectOfType <Testshit>();
            ui_manager = Object.FindObjectOfType <ListController>();

            deployUiElement = ui_manager.AddUiElement(
                Resources.Load <Sprite>("Sprites/" + component.towerPrototype),
                component.towerPrototype,
                cancel => {
                if (!cancel)
                {
                    testshit.BeginPlacement(component.towerPrototype,
                                            point => testshit.DeployCommand(GetComponent <EntityMirror>(), point),
                                            point => component.CheckBuildPlacement((Game.DVector3)point),
                                            () => {});
                }
            });
        }
コード例 #4
0
        void Start()
        {
            testshit   = Object.FindObjectOfType <Testshit>();
            buildables = new List <Buildable>();

            ui_manager = Object.FindObjectOfType <ListController>();

            for (var i = 0; i < component.buildables.Length; i += 1)
            {
                if (component.buildables[i] == null)
                {
                    continue;
                }
                var name      = component.buildables[i];
                var buildable = new Buildable();
                buildable.name      = name;
                buildable.id        = i;
                buildable.uiElement = ui_manager.AddUiElement(Resources.Load <Sprite>("Sprites/" + name),
                                                              name,
                                                              (cancel) => DoBuild(buildable, cancel));
                buildables.Add(buildable);
            }
        }