protected void Update() { if (!m_Trader) { return; } float s = Mathf.PingPong(Time.time * m_BlinkSpeed, 1.0f); m_ConsistentScale = (s * (m_MaxBlink - m_MinBlink)) + m_MinBlink; if (!m_Comrade) { X0V x0v = GunnerLodge.Instance.X0V; Vector2 dir = x0v.transform.position - transform.position; float sqrDist = dir.sqrMagnitude; if (sqrDist <= m_TradeDistance * m_TradeDistance) { CalculateTime(true, m_SacrificeIcons); if (Input.GetButtonDown("Sacrifice")) { m_Comrade = x0v; m_Comrade.AddDebuff(m_Debuff); // Sorry bro HudManager.Instance.CreateDebuffIcon(m_Debuff.Type.ToString()); m_TradeIcons.SetActive(true); m_SacrificeIcons.SetActive(false); PlaySound(m_SacrificeClip, 1.5f); } } else { CalculateTime(false, m_SacrificeIcons); } } else { Vector2 dir = m_Comrade.transform.position - transform.position; float sqrDist = dir.sqrMagnitude; if (sqrDist <= m_TradeDistance * m_TradeDistance) { if (Input.GetButtonDown("Trade")) { Trade(m_Comrade); PlaySound(m_TradeClip, 1.5f, .8f); } CalculateTime(true, m_TradeIcons, m_TradeOverride); } else { CalculateTime(false, m_TradeIcons, m_TradeOverride); } } }
private void OnTriggerEnter2D(Collider2D collision) { X0V x0v = collision.GetComponent <X0V>(); if (x0v) { // DO finish Game.Instance.LoadWinScreen(); } }
private void Start() { Gunners = FindObjectsOfType <Gunner>().ToList(); X0V = FindObjectOfType <X0V>(); }