private void OnEnable() { IEnumerable <Type> moduleTypes = Assembly.GetAssembly(typeof(EffectModule)) .GetTypes().Where(t => t.IsClass && !t.IsAbstract && t.IsSubclassOf(typeof(EffectModule))); modulesMenu = new GenericMenu(); foreach (Type item in moduleTypes) { CustomEffectModuleAttribute attribute = (CustomEffectModuleAttribute)Attribute.GetCustomAttribute(item, typeof(CustomEffectModuleAttribute)); if (attribute == null || string.IsNullOrEmpty(attribute.MenuName)) { continue; } /* For optional attribute * string name = attribute != null && !string.IsNullOrEmpty(attribute.MenuName) ? * attribute.MenuName : ObjectNames.NicifyVariableName(item.Name); */ //Debug.Log("Added to menu: " + item); modulesMenu.AddItem(new GUIContent(attribute.MenuName), false, () => AddModule(item)); } effect = (NeepEffect)target; //effect.OnAddModulePress += OpenModulesMenu; }
protected override void OnInitialize(NeepEffect owner) { if (profile == null) { profile = CreateInstance <PostProcessProfile>(); } volume = owner.ContainerGameObject.AddComponent <PostProcessVolume>(); volume.isGlobal = true; volume.sharedProfile = profile; // Warm up the unloaded shaders to avoid "hiccups" with the fps when the effect starts // (Not really working) Shader.WarmupAllShaders(); // TODO: create an instance of ShaderVariantCollection add the shaders and call WarmUp() }
protected override void OnInitialize(NeepEffect owner) { filter = Owner.Manager.AudioListener.gameObject.AddComponent <AudioFilterT>(); }
protected override void OnInitialize(NeepEffect owner) { ui = owner.Manager.UI; }
protected virtual void OnInitialize(NeepEffect owner) { }
internal void Initialize(NeepEffect owner) { this.owner = owner; OnInitialize(owner); }