Example #1
0
    //---------------------------------------------------------
    // Use this for initialization
    void Start()
    {
        Animator animator = GetComponent <Animator>();

        jin = GameObject.Find("jinanimation1");
        jin.SetActive(false);

        //查找储存了场景数据的SceneDate
        SetUi(false);
        SceDate = GameObject.Find("SceneDate");
        CoverCardCan.SetActive(true);
        BlackCan.SetActive(true);
        if (SceDate != null)
        {
            //先将Ui显示出来
            SetUi(true);

            //根据获取的数据创建敌人
            LevelName = SceDate.GetComponent <SceStar>().Re_LevelName();
            LELnum    = SceDate.GetComponent <SceStar>().Re_LELNum();
            //去除空格
            string n = LevelName.Replace(" ", "");
            // Debug.Log("去除空格"+n);
            //执行反射,准备生成敌人
            // LEL.NewLevel_Enemy(LevelName);
            this.GetComponent <Level_Enemy_Lib>().NewLevel_Enemy(n, LELnum);
            EnemyNum = DmScr._instance.Re_EnemyNum();
            //获取场景数据生成场景
            this.GetComponent <GroundScr>().GetSceGround();
            //撤下遮布
            BlackCan.SetActive(false);
            //初始化场景数据
            // SceDate.GetComponent<SceStar>().InitDate();
            //新建临时玩家,一般情况下是独挡新建玩家实例
            PlayerDate._instance.Testlinshi();
            //执行开始游戏
            EnemyCan.GetComponent <StartGame>().StartButton();
        }
        else
        {
            Debug.Log("数据未找到!");
            SceneManager.LoadScene(5);
        }
    }
Example #2
0
 public void SetCardUi(bool n)
 {
     CoverCardCan.SetActive(n);
 }