private void DrawScalogram() { var result = _waveletProcessor.Process(_functionGenerator.Generate(0, 1023, 1)); scalogram.Image = ColorVisualizer.DrawGraphic(result, 100); ColorVisualizer.DrawSignatureTwoPowers(System.Drawing.Graphics.FromImage(scalogram.Image), scalogram.Image, 0, 1023, 0, 250); }
private void Start() { Debug.LogFormat("{0}, {1}, {2}", currentColor.r, currentColor.g, currentColor.b); //Adds all the colors to the colorsList colors.Add(Color.black); colors.Add(Color.red); colors.Add(Color.green); colors.Add(Color.blue); currentColorVisualizer = GetComponentInChildren <ColorVisualizer>(); currentColorVisualizer.AddColor(colors[currentColorIndex]); }
void LobShot() { Debug.Log("LobShot"); //Set up references and instantiate GameObject spawnedProjectile = Instantiate(projectilePrefab, spawnPoint.position, spawnPoint.rotation); Rigidbody spawnedProjectileRB = spawnedProjectile.GetComponent <Rigidbody>(); projectileScriptComp = spawnedProjectile.GetComponent <ProjectileScript>(); ColorVisualizer projectileColorVisualizer = spawnedProjectile.GetComponent <ColorVisualizer>(); //Change variables and adding force spawnedProjectileRB.AddForce(spawnedProjectile.transform.forward * Time.deltaTime * 50000f); projectileColorVisualizer.AddColor(colors[currentColorIndex]); projectileColorVisualizer.isProjectile = true; projectileScriptComp.projectileColor = colors[currentColorIndex]; projectileScriptComp.instantiater = this.gameObject; if (rightClick) { projectileScriptComp.addColor = false; } }
private void OnCollisionEnter(Collision collision) { if (projectileColor != Color.black && isUsed == false) { Debug.Log("Collision happened"); ColorVisualizer hitVisualizer = collision.gameObject.GetComponent <ColorVisualizer>(); if (hitVisualizer != null && hitVisualizer.isProjectile == false) { if (addColor) { hitVisualizer.AddColor(projectileColor); DisableProjectile(); } else { hitVisualizer.SubtractColor(projectileColor); DisableProjectile(); } } } }
private void RankingCompletedHandler(object sender, RankingEventArgs e) { // Remove event handler for currently selected ranker SelectedRanker.RankingCompleted -= RankingCompletedHandler; GraphComponents graph = GraphManager.Instance.DefaultGraphComponentsInstance; List <RankingData> data = new List <RankingData>(); if (_colorVisualizer == null) { _colorVisualizer = new ColorVisualizer(e.Results.Values.Min(), e.Results.Values.Max()); } else { _colorVisualizer.Reset(e.Results.Values.Min(), e.Results.Values.Max()); } _scaleVisualizer = new ScaleVisualizer(); foreach (INode node in e.Results.Keys) { RankingData rankingData = new RankingData { Score = e.Results[node], NodeCount = 1 }; if (data.Contains(rankingData)) { data[data.IndexOf(rankingData)].NodeCount += 1; } else { data.Add(rankingData); } NodeViewModelBase nodeVM = graph.GetNodeViewModel(node) as NodeViewModelBase; if (nodeVM != null) { if ((VisualizationOption & VisualizationOptions.Color) == VisualizationOptions.Color) { _colorVisualizer.Visualize(nodeVM, e.Results[node]); } else { _colorVisualizer.ClearVisualization(nodeVM); } if ((VisualizationOption & VisualizationOptions.Scale) == VisualizationOptions.Scale) { _scaleVisualizer.Visualize(nodeVM, e.Results[node]); } else { _scaleVisualizer.ClearVisualization(nodeVM); } } } Scores = new ObservableCollection <RankingData>(data.OrderBy(rankData => rankData.Score)); IsActive = true; }