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);
    }
예제 #2
0
 public void StopSupportingInteraction(INTERACTION interaction)
 {
     if (SupportsInteraction(interaction))
     {
         interactionBitSet.ClearBit((int)interaction);
         if (RegistersWithGroup(interaction) && InteractionGroups.instance != null)
         {
             InteractionGroups.instance.UnregisterWithGroup(interaction, this);
         }
     }
 }
예제 #3
0
 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);
    }
예제 #5
0
 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();
 }
예제 #6
0
    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);
        }
    }
예제 #7
0
    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);
            }
        }
    }
예제 #11
0
 public INTERACTION_CONTEXT_CONFIGURATION(INTERACTION interaction, INTERACTION_CONFIGURATION_FLAGS enable)
 {
     Interaction = interaction;
     Enable      = enable;
 }
예제 #12
0
 public bool SupportsInteraction(INTERACTION requiredInteraction)
 {
     return(interactionBitSet.IsSet((int)requiredInteraction));
 }
예제 #13
0
 public INTERACTION_CONTEXT_CONFIGURATION(INTERACTION interaction, INTERACTION_CONFIGURATION_FLAGS enable)
 {
     Interaction = interaction;
     Enable = enable;
 }