public List <GameObject> GetAllObjectsMeetsType(PhysicsInteractionInfo.PhysicsInteractionType targetType)
    {
        var ans = new List <GameObject>();

        foreach (PhysicsInteractionInfo.PhysicsInteractionType type in Enum.GetValues(typeof(PhysicsInteractionInfo.PhysicsInteractionType)))
        {
            if (((int)type & (int)targetType) > 0)
            {
                ans.AddRange(typeTargetDict[type]);
            }
        }
        return(ans);
    }
Example #2
0
    protected virtual void RunInteractionFunction(PhysicsInteractionInfo.PhysicsInteractionType targetType, InteractionAction.InteractionActionType actionType, string jsonParams)
    {
        if (ObjectManager.instance == null)
        {
            return;
        }
        var allTargetObjects = ObjectManager.instance.GetAllObjectsMeetsType(targetType);

        for (int i = 0; i < allTargetObjects.Count; i++)
        {
            if (allTargetObjects[i] != null)
            {
                RunSingleInteractionFunction(allTargetObjects[i], actionType, jsonParams);
            }
        }
    }