public static void LoadPlugins() { GameEngine.SayToServer(" - Scanning for plugins..."); foreach (string dll in Directory.GetFiles(".", "*.dll")) { // Prevent snagging on self when running as deployed executable if (dll.Contains(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name)) { continue; } Assembly asm = Assembly.LoadFrom(dll); foreach (Type type in asm.GetTypes()) { if (type.GetInterface("IPluggable") == typeof(IPluggable)) { IPluggable thisPlugin = Activator.CreateInstance(type) as IPluggable; GameEngine.SayToServer($"{thisPlugin.Name}..."); AllPlugins.Add(thisPlugin); if (type.GetInterface("IMappable") == typeof(IMappable)) { IMappable mapPlugin = Activator.CreateInstance(type) as IMappable; Mappers.Add(mapPlugin); } if (type.GetInterface("ISpawnable") == typeof(ISpawnable)) { ISpawnable spawnPlugin = Activator.CreateInstance(type) as ISpawnable; Spawners.Add(spawnPlugin); } if (type.GetInterface("IPlayerModifiable") == typeof(IPlayerModifiable)) { IPlayerModifiable playerPlugin = Activator.CreateInstance(type) as IPlayerModifiable; PlayerMods.Add(playerPlugin); } if (type.GetInterface("ICanOverrideAttackMethod") == typeof(ICanOverrideAttackMethod)) { ICanOverrideAttackMethod combatPlugin = Activator.CreateInstance(type) as ICanOverrideAttackMethod; AttackMod = combatPlugin; } if (type.GetInterface("ISpeakable") == typeof(ISpeakable)) { ISpeakable speechMod = Activator.CreateInstance(type) as ISpeakable; SpeechMods.Add(speechMod); } if (type.GetInterface("IFabricable") == typeof(IFabricable)) { IFabricable templateMod = Activator.CreateInstance(type) as IFabricable; TemplateMods.Add(templateMod); } } } } GameEngine.SayToServer("done.\n"); }
static void info(Zwierz z) { say(z.GetType() + z.name); if (z is ISpeakable) { ISpeakable zs = (ISpeakable)z; say(zs.GetVoice(Teoria.MyContansts.Loud)); } if (z is Pies) { (z as Pies).Merda(); } }
public override void Do() { base.Do(); speakable = speakableGameObject.GetComponent <ISpeakable>(); if (speakable == null) { onComplete?.Invoke(); Debug.Log($"{name} action havent speakable entity"); return; } startTime = Time.time; doing = true; speakable.Say(text, maxTime); }
public Hello(ISpeakable language) { Language = language; }
/// <summary> /// Inicializa las variables necesarias para el control de vos /// </summary> private void Init() { _Voice = new WindowsVoice(); _Voice.AddToSpeechQueue("Buenos días señor, en que le puedo ayudar"); }
/*to make it so that can call say hello and goodbye seperately and * cann from command line but changed to be like gregs * * public void Goodbye(){ * Language.SayGoodbye(); * }*/ public Hello(ISpeakable language) //constructor take a param { Language = language; //take an instance of a class and use it in another }