예제 #1
0
    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();
    }
예제 #2
0
    public void stopMove()
    {
        move_script script = this.GetComponent <move_script>();

        script.stopMove();
    }