Exemple #1
0
    private void Update()
    {
        //下移动
        if (Fish1.transform.position.y > 1.5)
        {
            Fish1.transform.position = Vector2.Lerp(Fish1.transform.position, new Vector2(Fish1.transform.position.x, -0.6f), Time.deltaTime * 0.5f);
        }

        //左移动
        else
        {
            Invoke("LeftMove", 0.2f);
            m_Fish1Move.Left();
            if (flg == 0)
            {
                StartCoroutine("Fire");
                flg = 1;
            }
        }
    }
 void LeftMove()
 {
     m_Fish1Move.Left();
     Fish1.transform.Translate(new Vector2(-2.18f, -1) * Time.deltaTime * 0.75f);
 }