public void creatBossBullet(Vector3 pos, Vector3 rot, WorldFishData bdata)
    {
        GameObject myBullet = (GameObject)Instantiate(GameController.GetInstance().getPrefab("BossBullet"), pos, Quaternion.identity, BattleLayer.transform);

        if (bdata != null)
        {
            myBullet.name = "BossBullet";
            myBullet.AddComponent <BossBullet> ().initBossBullet(rot, bdata);
        }
    }
    public void init(WorldFishData data)
    {
        fishData = data;
        speed    = fishData.getCurSpeed();

        mainRig = GetComponent <Rigidbody2D> ();
        tarRot  = Mathf.Atan2(fishData.direction.y, fishData.direction.x) * Mathf.Rad2Deg - 180f;
        //transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.Euler (0, 0, tarRot), 3f*Time.deltaTime);
        //	addForce (new Vector2 (fishData.direction.x * speed, fishData.direction.y * speed));
    }
 public void showWorldFishPanel(WorldFishData data)
 {
     if (worldFishPanel == null)
     {
         worldFishPanel = (GameObject)Instantiate(GameController.GetInstance().getPrefab("FishBossPanel"), new Vector3(Screen.width / 2, Screen.height / 2, 0), Quaternion.identity, transform);
     }
     worldFishPanel.SetActive(true);
     worldFishPanel.GetComponent <WorldFishPanel> ().init(data);
     AudioController.PlaySound(AudioController.SOUND_Panel);
 }
    void init()
    {
        missionPart = UI.transform.Find("MissionPart").gameObject;
        wave        = UI.transform.Find("Wave").gameObject;
        cannonText  = UI.transform.Find("Cannon").Find("Text").gameObject;
        cannonText.GetComponent <Text> ().text = cannonLevel.ToString();

        taskButton = UI.transform.Find("TaskButton").gameObject;
        if (PlayerData.getCurTask() == null)
        {
            taskButton.SetActive(false);
        }

        bulletText = UI.transform.Find("Bullet").Find("Text").GetComponent <Text>();
        refreshBulletCount();

        Music        = gameObject.GetComponent <AudioSource> ();
        Music.volume = PlayerData.getMusic();

        if (Screen.width >= 800)
        {
            float t = Mathf.Max((float)Screen.width / 650, (float)Screen.height / 960);
            Camera.main.orthographicSize = 2.25f + t / 2 * 6f;
        }
        else
        {
            cannonCanvas.transform.localScale = new Vector3(0.01f * Screen.width / 800, 0.01f * Screen.width / 800, 1f);
            BattleLayer.transform.localScale  = new Vector3(Screen.width / 800f, Screen.width / 800f, 1f);
        }

        GameController.WorldBound = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, 0));


        fishMaxCount = (Screen.width / 800 - 1) * 20 + 50;

        bossData = GameController.GetInstance().bossData;
        if (bossData != null)
        {
            BattleMode = BattleFormation.BossMode;
            creatBossCannon(bossData);
            taskButton.SetActive(false);
        }
        else if (GameController.GetInstance().missionFishData != null)
        {
            missionData = GameController.GetInstance().missionFishData;
            BattleMode  = BattleFormation.MissionMode;
            taskButton.SetActive(false);
            missionPart.SetActive(true);
        }
    }
    public void initBossBullet(Vector3 rot, WorldFishData pData)
    {
        petData        = pData;
        bulletAnimator = transform.GetComponent <Animator>();
        bulletAnimator.Play(pData.getBulletName());


        float tar = Mathf.Atan2(rot.y, rot.x) * Mathf.Rad2Deg;

        transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.Euler(0, 0, tar), 3f);


        float speed = pData.getBulletSpeed() * 2;

        GetComponent <Rigidbody2D> ().AddForce(new Vector2(rot.x * speed * 2, rot.y * speed * 2));
    }
    void creatBossCannon(WorldFishData data)
    {
        GameObject fishCannon = (GameObject)Instantiate(GameController.GetInstance().getPrefab("BossCannon"), getBossPosition(), Quaternion.identity, cannonCanvas.transform);

        fishCannon.GetComponent <BossFish> ().init(data);
    }
 public void init(WorldFishData data)
 {
     worldFishData = data;
 }
    void creatWorldFish(WorldFishData data)
    {
        GameObject pFish = (GameObject)Instantiate(GameController.GetInstance().getPrefab(data.getFishName()), data.position, Quaternion.identity, WorldFishCanvas.transform);

        pFish.AddComponent <WorldFish> ().init(data);
    }