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 => {}); }
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); } }); }
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), () => {}); } }); }
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); } }