Пример #1
0
    void Start()
    {
        GameCampScript s = GameCampData.instance.getData(GameUserData.instance.Stage);

        GameCampUI.instance.show(s);

        GameBlackUI.instance.unShowBlack(1.0f, null);

        GameTouchCenterUI.instance.showUI();
    }
Пример #2
0
    public void loadScript(int stage)
    {
        string path     = stage < 10 ? "0" + stage.ToString() : stage.ToString();
        string pathName = Application.dataPath + "/Objects/DAT/Camp/Script/CAMP" + path + ".dat";

        if (!File.Exists(pathName))
        {
            return;
        }

        FileStream fs = File.OpenRead(pathName);

        byte[] bytes = new byte[fs.Length];
        fs.Read(bytes, 0, (int)fs.Length);
        fs.Close();

        int index = 0;

        data[stage]         = new GameCampScript();
        data[stage].Camp    = BitConverter.ToInt16(bytes, index); index += 2;
        data[stage].Town    = BitConverter.ToInt16(bytes, index); index += 2;
        data[stage].TownPos = BitConverter.ToInt16(bytes, index); index += 2;
    }
Пример #3
0
    public void show(GameCampScript s)
    {
        script = s;

        show();

        string path = "Prefab/Camp/Image/camp" + GameDefine.getString2(script.Camp);

        GameObject gameOjbect = Resources.Load <GameObject>(path);
        GameObject obj        = Instantiate(gameOjbect, transBackground);
        Transform  trans      = obj.transform;

        trans.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
        trans.localScale    = new Vector3(1.0f, 1.0f, 1.0f);

        gameAnimation         = obj.GetComponent <GameAnimation>();
        gameAnimation.UI      = true;
        gameAnimation.offsetX = -(int)(GameCameraManager.instance.sceneWidthHalf - GameCameraManager.instance.xOffset);
        gameAnimation.offsetY = (int)(GameCameraManager.instance.sceneHeightHalf);
        gameAnimation.playAnimation();

        GameCampSelectUI.instance.show(0);
        GameCampSelectUI.instance.showFade();
    }