Example #1
0
        /// <summary>
        /// Set default values taken from the assigned group.
        /// </summary>
        /// <param name="group">The group this schema has been added to.</param>
        protected override void OnSetGroup(AddressableAssetGroup group)
        {
            //this can happen during the load of the addressables asset
            if (group.Settings != null)
            {
                if (BuildPath == null || string.IsNullOrEmpty(BuildPath.GetValue(group.Settings)))
                {
                    m_BuildPath = new ProfileValueReference();
                    BuildPath.SetVariableByName(group.Settings, AddressableAssetSettings.kLocalBuildPath);
                }

                if (LoadPath == null || string.IsNullOrEmpty(LoadPath.GetValue(group.Settings)))
                {
                    m_LoadPath = new ProfileValueReference();
                    LoadPath.SetVariableByName(group.Settings, AddressableAssetSettings.kLocalLoadPath);
                }
            }

            if (m_AssetBundleProviderType.Value == null)
            {
                m_AssetBundleProviderType.Value = typeof(AssetBundleProvider);
            }
            if (m_BundledAssetProviderType.Value == null)
            {
                m_BundledAssetProviderType.Value = typeof(BundledAssetProvider);
            }
        }
 public void Load(ref Log returnLog)
 {
     if (LoadPath.Contains("http://"))
     {
         throw new NotImplementedException();
     }
     else
     {
         using (StreamReader r = new StreamReader(LoadPath))
         {
             string    json   = r.ReadToEnd();
             DataTable jsonDT = (DataTable)JsonConvert.DeserializeObject(json, (typeof(DataTable)));
             Data = new DataSet();
             Data.Tables.Add(jsonDT);
         }
     }
 }
Example #3
0
 public void PlaySound(string resourcePath, float volume = 1f, float delay = 0f, LoadPath loadPath = LoadPath.Resources, bool useSearchPath = true, string searchPath = "")
 {
     if (Volume < 0.01f)
     {
         return;
     }
     if (loadPath == LoadPath.Resources)
     {
         AudioClip audioClip = Resources.Load <AudioClip>((useSearchPath ? searchPath : "") + resourcePath);
         if (null != audioClip)
         {
             audioClip.name = resourcePath;
             PlaySound(audioClip, volume, delay);
         }
         else
         {
             Debug.LogWarning("AudioManager PlaySound Not Found: " + resourcePath);
         }
     }
     else
     {
         LoadFromStreamingAssets(resourcePath, delegate(AudioClip audioClip)
         {
             audioClip.name = resourcePath;
             PlaySound(audioClip, volume, delay);
         }, useSearchPath, searchPath);
     }
 }
Example #4
0
 public string PlayMusic(string resourcePath, float volume = 1f, bool isLoop = true, bool dontDestroy = false, LoadPath loadPath = LoadPath.Resources, bool useSearchPath = true, string searchPath = "")
 {
     if (_dicMusicPath.ContainsKey(resourcePath) && null != _dicMusicPath[resourcePath])
     {
         AudioSource audioSource = _dicMusicPath[resourcePath];
         if (!audioSource.isPlaying)
         {
             audioSource.loop = isLoop;
             audioSource.Play();
         }
         foreach (string key in _dicMusicGUID.Keys)
         {
             if (_dicMusicGUID[key] == audioSource)
             {
                 return(key);
             }
         }
     }
     else
     {
         if (loadPath == LoadPath.Resources)
         {
             AudioClip audioClip = Resources.Load <AudioClip>((useSearchPath ? searchPath : "") + resourcePath);
             if (null != audioClip)
             {
                 string      id          = PlayMusic(audioClip, volume, isLoop, dontDestroy);
                 AudioSource audioSource = _dicMusicGUID[id];
                 _dicMusicPath[resourcePath] = audioSource;
                 return(id);
             }
         }
         else
         {
             LoadFromStreamingAssets(resourcePath, delegate(AudioClip audioClip)
             {
                 if (null != audioClip)
                 {
                     string id = PlayMusic(audioClip, volume, isLoop, dontDestroy);
                     AudioSource audioSource     = _dicMusicGUID[id];
                     _dicMusicPath[resourcePath] = audioSource;
                 }
             }, useSearchPath);
         }
     }
     return(null);
 }
Example #5
0
        public override void Act(GameObject player, GameObject AI)
        {
            LoadPath findpath = GameObject.Find("maze").GetComponent <LoadPath>();

            findpath.changepath(AI.transform.position, player.transform.position);
        }
Example #6
0
        public override void DoBeforeLeaving(Transform AI, Transform point)
        {
            LoadPath findpath = GameObject.Find("maze").GetComponent <LoadPath>();

            findpath.changepath(AI.position, point.position);
        }
Example #7
0
 protected override string GetCacheName()
 {
     return(LoadPath.replace("bundle/" + base.GetCacheName() + ".assetbundle"));
 }