示例#1
0
        /// <summary>
        /// construct
        /// </summary>
        public Loader(uint fishId, string key)
        {
            this.Add<GameObject>(SharkDefine.GetFishFbxPath(key));
            this.Add<RuntimeAnimatorController>(SharkDefine.GetFishAnimatorControllerPath(key));
            this.Add<FishColliderData>(SharkDefine.GetFishColliderDataPath(key));

            var particles = Masters.FishParticleDB.GetList().FindAll(x => x.fishId == fishId);
            if (particles != null && particles.Count > 0)
            {
                this.particleDatas = new List<(string, IAssetLoader)>();

                for (int i = 0; particles != null && i < particles.Count; i++)
                {
                    this.particleDatas.Add((
                        attachingPosition: particles[i].attachingPosition,
                        assetLoader: this.Add<GameObject>(SharkDefine.GetFishParticlePath(key, particles[i].particleName))
                    ));
                }
            }
        }