コード例 #1
0
    public static void LoadData()
    {
        _protoDescs = new List <PrototypeDesc>();

        Mono.Data.SqliteClient.SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("PrototypeEffect");
        while (reader.Read())
        {
            PrototypeDesc rand = new PrototypeDesc();

            rand._pid            = System.Convert.ToInt32(reader.GetString(reader.GetOrdinal("id")));
            rand._strAssetbundle = null;
            rand._strPrefab      = reader.GetString(reader.GetOrdinal("prefab_path"));
            _protoDescs.Add(rand);
        }
    }
コード例 #2
0
    public static SceneStaticDoodadAgent Create(int protoId, Vector3 pos, Quaternion rotation, Vector3 scale, int id = SceneMan.InvalidID)
    {
        if (null == _protoDescs)
        {
            LoadData();
        }

        PrototypeDesc desc = _protoDescs.Find(it => it._pid == protoId);

        if (desc != null)
        {
            SceneStaticDoodadAgent ret = new SceneStaticDoodadAgent(desc._strPrefab, desc._strAssetbundle, pos, rotation, scale, id);
            return(ret);
        }
        return(null);
    }