protected override void Awake() { base.Awake(); AI = GetComponent <AIController>(); Anim = VisualHolder.GetComponent <Animator>(); VisualHolder.GetComponent <SpriteRenderer>().sortingLayerName = SortingLayer.Object; }
//Combat override public void DeductHealth(Damage dmg) { IC.PopUpText(dmg); if (dmg.Crit) { Animator Anim = VisualHolder.GetComponent <Animator>(); Anim.Play("crit"); //if (dmg.SFX_Update) // AudioSource.PlayClipAtPoint(crit_hurt, transform.position, GameManager.SFX_Volume); } //} else { // if (dmg.SFX_Update) // AudioSource.PlayClipAtPoint(hurt, transform.position, GameManager.SFX_Volume); //} if (CurrStats.Get(STATSTYPE.HEALTH) - dmg.Amount <= 0 && Alive) { ON_DEATH_UPDATE += Die; ON_DEATH_UPDATE(); ON_DEATH_UPDATE -= Die; } else { CurrStats.Dec(STATSTYPE.HEALTH, dmg.Amount); } }
private void RedrawDiagram() { int zoomWidth = (int)(m_graphWidth * m_widthZoom); Stopwatch watch = new Stopwatch(); watch.Start(); int threadCount = 0; if (m_timeline.IsChecked == true) { threadCount = 30; } DiagramData data = m_heapInfo.RenderDiagram(zoomWidth, m_graphHeight, m_diagramT0, m_diagramT1, true, threadCount, m_drawMarker.IsChecked == true, false); if (m_rubberBand != null) { m_rubberBand.Detach(); } m_diagramHolder = new VisualHolder(); m_rubberBand = new RubberBandAdorner(m_diagramHolder, m_diagramHolder.AddMessage, CreateContextMenu); m_diagramHolder.SetVisual(zoomWidth, m_graphHeight, data.visual, m_widthZoom, m_zoomSlider.Value, data.x0, data.x1); m_scrollViewer.Content = m_diagramHolder; m_scrollViewer.MouseMove += OnMouseMove; { DiagramData legend = m_heapInfo.RenderLegend(LegendWidth, m_graphHeight, threadCount); VisualHolder legendHolder = new VisualHolder(); legendHolder.SetVisual(LegendWidth, m_graphHeight, legend.visual, 1, 1, legend.x0, legend.x1); m_leftLegend.Children.Clear(); m_leftLegend.Children.Add(legendHolder); } watch.Stop(); m_statusBar.Log(String.Format("RadrawDiagram({0:N3} {1:N3}, {2}x{3} {4:N3} ms", m_diagramT0, m_diagramT1, zoomWidth, m_graphHeight, watch.Elapsed.TotalMilliseconds)); }