Beispiel #1
0
        IEnumerator AddCamera()
        {
            //yield return new WaitForSeconds(0.1f);
            yield return(new WaitForEndOfFrame());

            int Vocation = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PlayerCommonValue.PLAYER_FIELD_VISIBLE_VOCATION;

            if (HeroView == null)
            {
                GameObject heroViewCamera = (GameObject)Instantiate(HeroViewCameraPrefab);
                heroViewCamera.transform.parent        = HeroViewCameraTrans;
                heroViewCamera.transform.localPosition = Vector3.zero;
                heroViewCamera.transform.localScale    = Vector3.one;
                ContainerHeroView[] containerHeroViews = heroViewCamera.GetComponentsInChildren <ContainerHeroView>();
                int length = containerHeroViews.Length;
                if (length >= 2)
                {
                    HeroView       = containerHeroViews[0];
                    CompetitorView = containerHeroViews[1];
                }
            }
            HeroView.ShowHeroModelView(Vocation);
            Label_myName.text = PlayerManager.Instance.FindHeroDataModel().Name;
        }
Beispiel #2
0
    //private void InitHeroViewCamera()
    //{
    //    StartCoroutine("AddCamera");
    //}
    private void AddCamera()
    {
        //yield return new WaitForSeconds(0.1f);
        //yield return new WaitForEndOfFrame();
        int Vocation = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PlayerCommonValue.PLAYER_FIELD_VISIBLE_VOCATION;

        if (HeroView == null)
        {
            GameObject heroViewCamera = (GameObject)Instantiate(PVPHeroViewPrefab);
            heroViewCamera.transform.parent     = HeroViewCameraTrans;
            heroViewCamera.transform.localScale = Vector3.one;
            ContainerHeroView[] containerHeroViews = heroViewCamera.GetComponentsInChildren <ContainerHeroView>();
            int length = containerHeroViews.Length;
            if (length >= 2)
            {
                HeroView       = containerHeroViews[0];
                CompetitorView = containerHeroViews[1];
            }
        }
        HeroView.ShowHeroModelView(Vocation);
        var competitorData = PVPBattleManager.Instance.GetPVPPlayerData();

        CompetitorView.ShowHeroModelView(competitorData.byKind);
    }