Beispiel #1
0
 internal bool TryGetEffectWithType(Type t, out DrunkEffectData data)
 {
     if (_effects.Values.Any(x => x.RuntimeType.Equals(t)))
     {
         data = _effects.Values.First(x => x.RuntimeType.Equals(t));
         return(true);
     }
     data = null;
     return(false);
 }
Beispiel #2
0
        private static DrunkEffectData LoadSFX(byte[] bytes)
        {
            AssetBundle     bundle = AssetBundle.LoadFromMemory(bytes);
            var             shaderEffectMetadataGOPrefab = bundle.LoadAsset <GameObject>("Assets/ShaderEffectMetadata.prefab");
            GameObject      shaderEffectMetadataGO       = UnityEngine.Object.Instantiate(shaderEffectMetadataGOPrefab);
            ShaderEffect    shaderEffect = shaderEffectMetadataGO.GetComponent <ShaderEffect>();
            DrunkEffectData data         = new DrunkEffectData(shaderEffect);

            GameObject.Destroy(shaderEffectMetadataGO);
            bundle.Unload(false);
            return(data);
        }
Beispiel #3
0
 public DrunkEffectData[] GetAll()
 {
     DrunkEffectData[] data = new DrunkEffectData[_effects.Values.Count];
     _effects.Values.CopyTo(data, 0);
     return(data);
 }
 public NuisanceElement(DrunkEffectData data)
 {
     _data          = data;
     _referenceName = _data.Name;
     Enabled        = data.EnabledByDefault;
 }