public bool ChildClicked(int i, PointerEventData eventData) { var child = transform.GetChild(i); var rect = GetRect(child); return(CodePanel.IsInRect(rect, eventData.position)); }
protected override void Awake() { base.Awake(); PanelName = Default.PANEL_TYPE_CODE; Ins = this; }
void IPersistable.Save(SettingsStorage storage) { storage.SetValue("Code", Code); storage.SetValue("References", CodePanel.References.ToArray()); storage.SetValue("CodePanel", CodePanel.Save()); //storage.SetValue("ResultChart", ResultChart.Save()); //storage.SetValue("ResultGrid", ResultGrid.Save()); storage.SetValue("Parameters", _parameters.Save()); }
// Update is called once per frame void Update() { if (levelLoader.ShouldDisplayExecutionIndicators()) { panel = GameObject.Find("SolutionPanel").GetComponent <CodePanel>(); SortIndicators(); } else { //ClearIndicators(); } }
void IPersistable.Load(SettingsStorage storage) { Code = storage.GetValue <string>("Code"); CodePanel.References.Clear(); CodePanel.References.AddRange(storage.GetValue <CodeReference[]>("References")); CodePanel.Load(storage.GetValue <SettingsStorage>("CodePanel")); //ResultChart.Load(storage.GetValue<SettingsStorage>("ResultChart")); //ResultGrid.Load(storage.GetValue<SettingsStorage>("ResultGrid")); _parameters.Load(storage.GetValue <SettingsStorage>("Parameters")); CodePanel_OnCompilingCode(); }
private void CodePanel_OnCompilingCode() { var result = CompilationLanguages.CSharp.CompileCode(Code, Guid.NewGuid().ToString(), CodePanel.References, UserConfig.Instance.AnalyticsDir, UserConfig.Instance.AnalyticsDir); CodePanel.ShowCompilationResult(result, _analyticStrategy != null); if (result.HasErrors()) { return; } _scriptType = result.Assembly.GetTypes().FirstOrDefault(t => !t.IsAbstract && t.IsSubclassOf(typeof(Strategy))); }
public void InstantiateIndicators(List <Bot> bots) { panel = GameObject.Find("SolutionPanel").GetComponent <CodePanel>(); foreach (var bot in bots) { if (indicators.ContainsKey(bot)) { continue; } var indicator = Instantiate(GameObject.Find("ExecutionIndicator"), panel.transform.Find("RootContainer"), true); indicator.GetComponent <Image>().color = bot.Color; indicators.Add(bot, indicator); indicatorPositions.Add(bot, startingPosition); } }
void Awake() { instance = this; GetComponent <CanvasScaler>().referenceResolution = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height); miniMap = Instantiate(miniMap, transform); datePanel = Instantiate(datePanel, transform); saveLoadPanel = Instantiate(saveLoadPanel, transform); statisticPanel = Instantiate(statisticPanel, transform); gameMenu = Instantiate(gameMenu, transform); codePanel = Instantiate(codePanel, transform); // battlePanel = Instantiate(battlePanel, transform); provincePanel = Instantiate(provincePanel, transform); armyPanel = Instantiate(armyPanel, transform); HelpManager = Instantiate(HelpManager, transform); saveLoadPanel.prevMenu = gameMenu.gameObject; }
public override void _Ready() { // On ready /*#region*/ code_panel = GetNode <CodePanel>("MainPanel/CodePanel"); upgrade_panel = GetNode <Upgrades>("MainPanel/UpgradePanel"); auto_prod = GetNode <Autoproductions>("AutoProd"); work_in_progress = GetNode <Label>("CodeDetailsPanel/CurrentWork"); line_count = GetNode <Label>("CodeDetailsPanel/LineCount"); prod_rate = GetNode <Label>("CodeDetailsPanel/ProdRate"); /*#endregion*/ //TODO: panel selections upgrade_panel.Visible = false; auto_prod.Connect(nameof(Autoproductions.CharFromBuildings), this, nameof(_OnAutoProduct)); }
public void OnDrop(PointerEventData eventData) { Debug.Log("OnDrop - usuwanie obiektu"); if (eventData.pointerDrag != null) { if (!CodePanel.HasDraggedObjectAValidTag(eventData)) { Debug.Log($"Invalid tag: {eventData.pointerDrag.tag}"); return; } Delete(eventData.pointerDrag); //CodePanel.Remove(eventData.pointerDrag); //GameObject.Find("RaycastManager").GetComponent<RaycastManagerScript>().SetRaycastBlockingAfterInstructionReleased(); RaycastManagerScript.SetRaycastBlockingAfterInstructionReleased(); } }
public StrategyInfoCodeContent() { InitializeComponent(); _timer = new ResettableTimer(TimeSpan.FromSeconds(1), "Compilation"); _timer.Elapsed += canProcess => GuiDispatcher.GlobalDispatcher.AddAction(CompileCode); var persSvc = ConfigManager.GetService <IPersistableService>(); CodePanel.References.AddRange(persSvc.GetReferences()); CodePanel.ReferencesUpdated += () => persSvc.SetReferences(CodePanel.References); CodePanel.SavingCode += SaveCode; CodePanel.CompilingCode += CompileCode; CodePanel.CodeChanged += _timer.Activate; var cmdSvc = ConfigManager.GetService <IStudioCommandService>(); cmdSvc.Register <CompileStrategyInfoResultCommand>(this, true, cmd => CodePanel.ShowCompilationResult(cmd.Result, GetStrategiesState())); cmdSvc.Register <EditReferencesCommand>(this, true, cmd => CodePanel.EditReferences()); }
void IPersistable.Save(SettingsStorage storage) { storage.SetValue("CodePanel", CodePanel.Save()); }
void IPersistable.Load(SettingsStorage storage) { CodePanel.Load(storage.GetValue <SettingsStorage>("CodePanel")); }
void OnDestroy() { Ins = null; }
void Awake() { instance = this; }