fBaseXtensions.HookHandler.SetHookValue C# (CSharp) Method

SetHookValue() public static method

public static SetHookValue ( HookType type, int index, Composite value, bool insert = false ) : bool
type HookType
index int
value Composite
insert bool
return bool
        public static bool SetHookValue(HookType type, int index, Composite value, bool insert = false)
        {
            if (!TreeHooks.Instance.Hooks.ContainsKey(type.ToString())) return false;

            if (!insert)
            {
                TreeHooks.Instance.Hooks[type.ToString()][index] = value;
                Logger.DBLog.DebugFormat("Replaced Hook [{0}]", type.ToString());
                return true;
            }
            else
            {
                TreeHooks.Instance.Hooks[type.ToString()].Insert(index, value);
                Logger.DBLog.DebugFormat("Inserted composite for Hook [{0}] at index {1}", type.ToString(), index);
                return true;
            }
        }