public void RemovePlugin(MotionPlugin.TYPE type) { if (!System.Array.Exists(Plugins, x => x.Type == type)) { Debug.Log("Plugin of type " + type.ToString() + " does not exist."); } else { ArrayExtensions.Remove(ref Plugins, System.Array.Find(Plugins, x => x.Type == type)); } }
public void AddPlugin(MotionPlugin.TYPE type) { if (System.Array.Exists(Plugins, x => x.Type == type)) { Debug.Log("Plugin of type " + type.ToString() + " already exists."); } else { switch (type) { case MotionPlugin.TYPE.Style: ArrayExtensions.Add(ref Plugins, new StylePlugin(this)); break; case MotionPlugin.TYPE.Phase: ArrayExtensions.Add(ref Plugins, new PhasePlugin(this)); break; } } }