// Update is called once per frame void Update() { if (trigUpdate == true) //one interaction at a time { return; } if (trigUpdate) { this.GetComponent <Rigidbody> ().velocity = (cellStats.getVector() * cellStats.getSpeed()); cellStats.formToGrid(); trigUpdate = false; } }
/*// if adding code here, test the upgarde to feedercell action in (OnCollisionEnter) * void Start () { * * } */ // Update is called once per frame void Update() { if (trigUpdate) { this.GetComponent <Rigidbody> ().velocity = (cellStats.getVector() * cellStats.getSpeed()); cellStats.formToGrid(); trigUpdate = false; } /* * if (cellStats.getSpeed() != 0.0f) {//reduce overhead further? * this.transform.Translate (cellStats.getVector() * (cellStats.getSpeed() * Time.deltaTime)); * * } */ }