Ejemplo n.º 1
0
    void InitNPC()                                                                       //敌人加载
    {
        int          NPCNum      = 0;                                                    //NPC数量
        int          guanID      = PlayerData.Instance.GuanNow;
        XuanGuanData data        = XuanGuanDataManager.Instance.GetXuanGuanData(guanID); //获取关卡数据
        NPCGuanData  NPCGuanData = NPCGuanDataManager.Instance.GetNPCGuanData(data.npcGuanID);

        for (int i = 0; i < NPCGuanDataManager.NPCNumMax; i++)
        {
            if (NPCGuanData.npcID[i] == 0)
            {
                continue;
            }
            NPCData    npcData = NPCDataManager.Instance.GetNPCData(NPCGuanData.npcID[i]);
            GameObject prefab  = (GameObject)Resources.Load("Prefab/Animator/" + npcData.prefabName);
            GameObject objNPC  = Instantiate(prefab);
            objNPC.transform.parent = transform;
            objNPC.transform.Rotate(0, 180, 0);
            objNPC.transform.position = new Vector3(NPCNum * 1.5f, 0, 5);
            NPCNum++;

            Character cha = objNPC.AddComponent <Character>();
            cha.SetCharactorData(npcData.ID, 1);
            npcList.Add(objNPC);
        }
    }
Ejemplo n.º 2
0
    void InitShuoming2()
    {
        guanID = PlayerData.Instance.GuanNow;
        XuanGuanData data = XuanGuanDataManager.Instance.GetXuanGuanData(guanID);

        textName.text = data.name;
        for (int i = 0; i < textNum.Length; i++)
        {
            textNum[i].text = data.num[i] + "";
        }
        int begin = 0;

        int[][] generalList = PlayerData.Instance.generalList;
        for (int i = 0; i < imIcon.Length; i++)
        {
            imIcon[i].gameObject.SetActive(false);
            for (int j = begin; j < generalList.Length; j++)
            {
                if (generalList[j][1] == 0)
                {
                    continue;
                }
                if (generalList[j][2] == 0)
                {
                    continue;
                }
                begin = j + 1;
                imIcon[i].gameObject.SetActive(true);
                GeneralData wujaingData = GeneralDataManager.Instance.GetGeneralData(generalList[j][0]);
                Image       im          = ImageManager.Instance.GetImage(wujaingData.imName);
                imIcon[i].sprite = im.sprite;
                break;
            }
        }
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        XuanGuanData data = XuanGuanDataManager.Instance.GetXuanGuanData(4);

        if (!PlayerData.Instance.bInit)
        {
            PlayerData.Instance.bInit = true;
            InitPlayData();
        }
    }
Ejemplo n.º 4
0
    public void LoadFile(string fileName)
    {
        MyLoad file = new MyLoad();

        file.LoadFile(fileName);
        for (int i = 0; i < file.dataList.Count; i++)
        {
            XuanGuanData data = new XuanGuanData((ArrayList)file.dataList[i]);
            dataList.Add(data);
        }
    }
Ejemplo n.º 5
0
    public void SetID(int id)
    {
        guanID = id;
        XuanGuanData data = XuanGuanDataManager.Instance.GetXuanGuanData(id);

        textName.text     = data.name;
        textShuoming.text = data.shuoming;
        for (int i = 0; i < textNum.Length; i++)
        {
            textNum[i].text = data.num[i].ToString();
        }
    }
Ejemplo n.º 6
0
    int guanID;//关卡ID

    public void SetID(int id)
    {
        guanID = id;
        XuanGuanData data = XuanGuanDataManager.Instance.GetXuanGuanData(id);

        textName.text = data.name;

        //判断是否过关开启
        Image  imGuan;
        Button btn = imIcon.transform.Find("Button").GetComponent <Button>();

        if (data.ID <= PlayerData.Instance.OpenGuan)
        {
            imGuan      = ImageManager.Instance.GetImage("WarInfo1_1L");
            btn.enabled = true;
        }
        else
        {
            imGuan      = ImageManager.Instance.GetImage("WarInfo1_1D");
            btn.enabled = false;
        }
        imIcon.sprite = imGuan.sprite;
    }