示例#1
0
    public void InitData(Hero hero, HeroIconType heroicontype = HeroIconType.HeroScene)
    {
        //Reset();
        heroIconType = heroicontype;
        mHero        = hero;
        HeroTableData data = DataManager.GetInstance().GetHeroTableDataByHeroId(0);

        if (data != null)
        {
            AddIcon(data.icon);
        }
        icon.gameObject.SetActive(true);
        noteam.gameObject.SetActive(false);
        Text text = qualityTxtArr[(int)hero.heroQuality];

        text.gameObject.SetActive(true);
        GetComponent <Image>().color = text.color;
        //GameObject obj = DataManager.GetInstance().CreateGameObjectFromAssetsBundle("", "Sword 01 Black");
        //if (obj != null && Camera.main != null)
        //{
        //    obj.transform.SetParent(Camera.main.transform.parent,false);
        //    //if (ItemShow != null && heroSceneCamera != null)
        //    {
        //        Vector3 pos = transform.position;
        //        obj.transform.position = Camera.main.ScreenToWorldPoint(pos);
        //    }

        //}
    }
示例#2
0
 public void Reset()
 {
     icon.gameObject.SetActive(false);
     noteam.gameObject.SetActive(true);
     for (int i = 0; i < qualityTxtArr.Length; i++)
     {
         qualityTxtArr[i].gameObject.SetActive(false);
     }
     GetComponent <Image>().color = Color.white;
     heroIconType = HeroIconType.NULL;
     mTeamPostion = -1;
 }