public void Cast(bool casting) { GameObject _casting = m_castingObj; Vector2 screenCenter = new Vector2(m_cam.pixelWidth / 2, m_cam.pixelHeight / 2); if (casting && m_resourceControl.balance > 0) { _casting = Instantiate(_casting, m_castPoint, transform.rotation); _casting.GetComponent <LucidityControl>().Deposit(m_castCost); _casting.GetComponent <Rigidbody>().AddForce(m_cam.transform.forward * m_castForce, ForceMode.Impulse); m_resourceControl.Deposit(-m_castCost); } }
public void OnCollisionEnter(Collision other) { m_rigBodRef.useGravity = true; lifeSpan *= 10; if (other.collider.gameObject.transform.tag == ("Player")) { if (m_plrResCont.balance < m_plrResCont.limit) { m_plrResCont.Deposit(1); Destroy(this.gameObject); } } }
public void Update() { if (!m_draining) { m_DrainEffect.Stop(); } else { Debug.Log("in!"); m_resCont.Withdraw(rps); m_plrResCont.Deposit(rps); } //transform.localScale = new Vector3(m_resCont.balance, m_resCont.balance, m_resCont.balance); m_draining = false; }