Beispiel #1
0
    public void CreateSavePoint(MapInfo.Position data)
    {
        GameObject go = Game.Database.CreateEffect("guanghuan");

        go.transform.SetParent(m_savePointRoot);
        data.CopyTo(go.transform);
        go.AddComponent <SavePoint>();
    }
Beispiel #2
0
    public void Born(MapInfo.Position position)
    {
        SaveData.Record record = Game.Record;

        GameObject go = Game.Database.LoadResource("Roles/" + record._class.ToString());

        go.name = record.name;
        go.transform.SetParent(m_playerRoot);

        CharacterController cc = go.AddComponent <CharacterController>();

        cc.center = new Vector3(0, 1, 0);

        const float scale = 0.6f;

        go.transform.localScale = new Vector3(scale, scale, scale);
        position.CopyTo(go.transform);

        Game.camera.target = go.transform;

        Role role = go.AddComponent <Role>();

        role.team        = Role.Team.Blue;
        role.m_MoveSpeed = 5;

        LevelInfo levelInfo = Game.Database.GetLevelInfo(record.level);

        role.hp  = levelInfo.hp;
        role.atk = levelInfo.atk;
        role.def = levelInfo.def;

        go.AddComponent <Player>();

        m_roles.Add(role);
        m_player = role;
    }