コード例 #1
0
        public void LoadMy(Vector3 pos)
        {
            int playerId = PlayerData.PlayerId, index = 0;

            _dicPlayerIndex.Add(index, playerId);

            BattleField field = ResourceLoader.LoadAssetAndInstantiate("Prefab/BattleFiled", BattleRootTran, pos).GetComponent <BattleField>();

            field.Load(playerId, PlayerData.CurHero, PlayerData.CurScene);
            _dicField.Add(playerId, field);

            BattleHero heroM = ResourceLoader.LoadAssetAndInstantiate("Prefab/BattleHero", _dicField[playerId].ForegroundTran).GetComponent <BattleHero>();

            heroM.Init(playerId, false, PlayerData.CurHero);
            _dicHeros.Add(playerId, heroM);
        }
コード例 #2
0
        public void LoadOther(Vector3 pos, BattlePlayerData other, int index, float scale)
        {
            int playerId = other.PlayerId;

            _dicPlayerIndex.Add(index, playerId);

            BattleField field = ResourceLoader.LoadAssetAndInstantiate("Prefab/BattleFiled", BattleRootTran, pos).GetComponent <BattleField>();

            field.SetScale(scale);
            field.Load(playerId, other.HeroId, other.SceneId);
            _dicField.Add(playerId, field);

            BattleHero heroE = ResourceLoader.LoadAssetAndInstantiate("Prefab/BattleHero", _dicField[playerId].ForegroundTran).GetComponent <BattleHero>();

            heroE.Init(playerId, other.IsRobot, other.HeroId);
            _dicHeros.Add(playerId, heroE);
        }