Ejemplo n.º 1
0
        private PlayerModelBase CreateModel(PlayerCore playerCore, Component prefab)
        {
            var model = prefab.GetComponent <PlayerModelBase>();

            //todo FindClosestPlayer  only for offline mode
            model.Initialization(
                playerCore,
                serverNotify,
                FindClosestPlayerPosition,
                pool, mapCore.GetRandomPosition,
                imagesDeath.New().transform,
                levelMode,
                GetById);
            pool.Add(playerCore.Id, model);
            model.RespawnInstantly(mapCore.RandomPosition);
            model.name = playerCore.Name;
            model.transform.GetChild(0).GetComponent <TextMesh>().text = playerCore.Name;
            return(model);
        }