void changeDir() { //防止再次碰撞 deleteDistance(); constant.Direction dir = getNextDir(); if (dir == mDir) { mDir = getRandomDir(); mHasDes = false; } else { mDir = dir; mHasDes = true; GameObject obj = constant.getPlayer(); mEndX = obj.transform.position.x; mEndY = obj.transform.position.y; } move_script moveScript = this.gameObject.GetComponent <move_script> (); moveScript.stopMove(); Debug.Log("chagneDir:" + mDir); playDirAni(); setDirAcc(); }
public void stopMove() { move_script script = this.GetComponent <move_script>(); script.stopMove(); }