示例#1
0
文件: AvatarPool.cs 项目: Hengle/Fish
    public static GameObject GetBody(int id)
    {
        if (!pools.ContainsKey(id))
        {
            var prefab = MobAssets.LoadPrefab(id);
            pools[id] = GameObjectPoolUtil.Create(prefab);
        }

        var pool = pools[id];

        return(pool.Get());
    }
示例#2
0
    public override void OnInitialize()
    {
        PlayerInfo.Instance.SetProperty(PropertyType.Cuirass, 2);

        var playerAvatar = PlayerInfo.Instance.GetPlayerAvatar();
        var prefab       = MobAssets.LoadPrefab(playerAvatar.cuirass);
        var model        = GameObject.Instantiate(prefab);

        myPlayer = ActorCenter.Instance.Create(ActorType.Player, model.transform) as MyPlayer;

        var mapConfig = MapConfig.Get(SceneLoad.Instance.currentSceneId);

        myPlayer.position = mapConfig.bornPoint;
        myPlayer.propertyController.SetProperty(FightProperty.MoveSpeed, 20000);

        SkillCast.Instance.SetSkill(1, 10001);
        SkillCast.Instance.SetSkill(2, 10001);
        SkillCast.Instance.SetSkill(3, 10001);
        SkillCast.Instance.SetSkill(4, 10001);
        SkillCast.Instance.SetSkill(5, 10001);
    }