Exemplo n.º 1
0
    void init()
    {
        {
            s_script = transform.GetComponent <GameScript>();

            MainCamera    = GameObject.Find("Main Camera");
            AttackBtnList = transform.Find("AttackBtnList").gameObject;
            GameUI        = transform.Find("UI").gameObject;
        }

        //// 创建PVP英雄
        //{
        //    GameObject obj = GameUtil.CreatePVPHero();

        //    HeroList.Add(obj);
        //    heroScript = obj.GetComponent<HeroScript>();
        //    heroScript.addBloodBar();
        //}

        // 创建地牢英雄
        {
            GameObject obj = GameUtil.CreateDiLaoHero();
            HeroList.Add(obj);
            heroScript = obj.GetComponent <HeroScript>();
            heroScript.addBloodBar();
            heroScript.heroData.Speed = 0.02f;

            GameObject.Find("Main Camera").GetComponent <TrackGameObjScript>().startTrack(obj);
            GameObject.Find("Lights").GetComponent <TrackGameObjScript>().startTrack(obj);
        }

        // 怪物1
        {
            GameObject obj = GameUtil.CreateEnemy();
            obj.transform.localPosition = new Vector3(11.92f, -4.61f, 20f);

            obj.transform.localRotation = Quaternion.Euler(0, -90, 0);
            HobgoblinList.Add(obj);
            obj.GetComponent <HobgoblinScript>().addBloodBar();
        }

        // 怪物2
        {
            GameObject obj = GameUtil.CreateEnemy();
            obj.transform.localPosition = new Vector3(-11.92f, -4.61f, 20f);
            obj.transform.localRotation = Quaternion.Euler(0, 90, 0);

            HobgoblinList.Add(obj);
            obj.GetComponent <HobgoblinScript>().addBloodBar();
        }

        //Debug.Log(Mathf.Sin(Mathf.Deg2Rad * 0));
        //Debug.Log(Mathf.Cos(Mathf.Deg2Rad * 0));
    }