public void UnRegisterGroupChangedListener(INTERACTION group, IInteractionGroupListener listener) { InteractionGroup interactionGroup = null; if (!groupLists.TryGetValue(group, out interactionGroup) || interactionGroup.groupListeners.Count == 0) { return; } interactionGroup.groupListeners.Remove(listener); }
public void StopSupportingInteraction(INTERACTION interaction) { if (SupportsInteraction(interaction)) { interactionBitSet.ClearBit((int)interaction); if (RegistersWithGroup(interaction) && InteractionGroups.instance != null) { InteractionGroups.instance.UnregisterWithGroup(interaction, this); } } }
public void AddSupportForInteraction(INTERACTION interaction) { if (!SupportsInteraction(interaction)) { interactionBitSet.SetBit((int)interaction); if (RegistersWithGroup(interaction) && InteractionGroups.instance != null) { InteractionGroups.instance.RegisterWithGroup(interaction, this); } } }
public static List <InteractionController> GetObjsWithInteraction(INTERACTION group) { InteractionGroup interactionGroup = null; if (!instance.groupLists.TryGetValue(group, out interactionGroup)) { return(new List <InteractionController>()); } return(interactionGroup.objsInGroup); }
void OnDisable() { // register with the interaction type groups foreach (int setBit in interactionBitSet.GetListOfSetBits()) { INTERACTION interaction = (INTERACTION)setBit; if (RegistersWithGroup(interaction) && InteractionGroups.instance != null) { InteractionGroups.instance.UnregisterWithGroup(interaction, this); } } Disabled(); }
private bool RegistersWithGroup(INTERACTION interaction) { switch (interaction) { case INTERACTION.AFFECTED_BY_SHOCKWAVE: case INTERACTION.AFFECTED_BY_FORCE_SLAM: case INTERACTION.AI_TARGET: case INTERACTION.PULLED_BY_WARP_LINE: case INTERACTION.GRAPPLE_LOCKON: case INTERACTION.CAN_PASS_THROUGH: return(true); default: return(false); } }
public void MoveToScene(INTERACTION _scenename) { string scene = _scenename.ToString(); isOption = false; Time.timeScale = 1; if (_scenename == INTERACTION.DUNGEON || _scenename == INTERACTION.LOBBY) { LoadingSceneController.LoadScene(scene); } else { SceneManager.LoadScene(scene); } }
public void UnregisterWithGroup(INTERACTION group, InteractionController interactionCont) { InteractionGroup interactionGroup = null; if (!groupLists.TryGetValue(group, out interactionGroup) || interactionGroup.objsInGroup.Count == 0) { return; } if (interactionGroup.objsInGroup.Remove(interactionCont)) { foreach (IInteractionGroupListener listener in interactionGroup.groupListeners) { listener.ObjRemovedFromInteractionGroup(group, interactionCont); } } }
public void RegisterGroupChangedListener(INTERACTION group, IInteractionGroupListener listener) { InteractionGroup interactionGroup = null; if (!groupLists.TryGetValue(group, out interactionGroup)) { interactionGroup = new InteractionGroup(); groupLists[group] = interactionGroup; } // add to group listers, avoid duplicates if (interactionGroup.groupListeners.Contains(listener)) { return; } else { interactionGroup.groupListeners.Add(listener); } }
public void RegisterWithGroup(INTERACTION group, InteractionController interactionCont) { InteractionGroup interactionGroup = null; if (!groupLists.TryGetValue(group, out interactionGroup)) { interactionGroup = new InteractionGroup(); groupLists[group] = interactionGroup; } // add obj to group, avoid duplicates if (interactionGroup.objsInGroup.Contains(interactionCont)) { return; } else { interactionGroup.objsInGroup.Add(interactionCont); foreach (IInteractionGroupListener listener in interactionGroup.groupListeners) { listener.ObjAddedToInteractionGroup(group, interactionCont); } } }
public INTERACTION_CONTEXT_CONFIGURATION(INTERACTION interaction, INTERACTION_CONFIGURATION_FLAGS enable) { Interaction = interaction; Enable = enable; }
public bool SupportsInteraction(INTERACTION requiredInteraction) { return(interactionBitSet.IsSet((int)requiredInteraction)); }
public INTERACTION_CONTEXT_CONFIGURATION(INTERACTION interaction, INTERACTION_CONFIGURATION_FLAGS enable) { Interaction = interaction; Enable = enable; }